Questions tagged [comments]

A comment is a programming language construct used to embed non-compiled, programmer-readable annotations in the source code of a computer program.

In computer programming, a comment is a programming language construct used to embed programmer-readable annotations in the source code of a computer program.

Those annotations are potentially significant to programmers but are generally ignored by compilers and interpreters. Comments are usually added with the purpose of making the source code easier to understand. The syntax and rules for comments vary and are usually defined in a programming language specification.

The comment syntax can also be appropriated for consumption by a documentation generator tool.

Related Links

6274 questions
3
votes
2 answers

"Undefined local variable or method" error when using commontator gem for comments

I made a website in which people can share photo's (they are called pins in my code). I wanted to add a system in which, when someone clicks on the picture, they can comment on it. I decided to use the commontator gem and I installed it. My problem…
neils
  • 655
  • 2
  • 6
  • 12
3
votes
1 answer

Regex get everything after -- if not enclosed in quotes

I'm programming an Lua language syntax highlighter, so I need to handle comments. The libary wants an regex that outputs the string that needs to be colored. It should work like this: Input: test() --I'm a comment Output: --I'm a comment and…
Benedikt M.
  • 145
  • 1
  • 13
3
votes
1 answer

C# three forward slashes: can the template be changed?

In C#, XML comments begin with three forward slashes (///). For example: /// /// /// /// /// Is there any way to change the generated comment, for example to add…
Qodex
  • 299
  • 3
  • 12
3
votes
5 answers

Visual Studio 2008 indenting C comment /* */

I'm new to using Visual Studio 2008 IDE. Switching from vim. Is there a way to setup Visual Studio to automatically indent C comments /* */ such as: /* I want this: /* * Edit: Seems like Visual Studio 2008 has this behavior for…
Yada
  • 30,349
  • 24
  • 103
  • 144
3
votes
1 answer

Rails - embedded polymorphic comment list + add comment form - example?

Hey, all. Working on my first Rails app. I've searched all around - read a bunch of tutorials, articles, and forum posts, watched some screencasts, and I've found a few examples that come close to what I'm trying to do (notably…
odigity
  • 7,568
  • 4
  • 37
  • 51
3
votes
0 answers

R - What is the proper way comment out a roxygen tag?

Say I want to comment out a #' @export tag - what is the documented way to do so? Adding a # in front (as with standard R comments) doesn't seem to work: ##' @export foo still leads to export(foo) in my NAMESPACE file. Can I also block-comment out…
mchen
  • 9,808
  • 17
  • 72
  • 125
3
votes
1 answer

Display only newest comments from author

Hi I have code to display comment list in my template. my question is possible to display only newest comment from the author. Example: If author B has made 3 comment in same post, i want to display just newest comment from author B and…
3
votes
9 answers

Positioning of comments relative to code

What is the best way to put comments in your code? I see at least three different ways: 1: int i = 10; //Set i to 10 2: //Set i to 10 int i = 10; 3: int i = 10; //Set i to 10 The disadvantage of using the first method is that many people use…
gamedevv
  • 315
  • 1
  • 4
  • 8
3
votes
5 answers

What is the usage of Nested comments in some programming languages?

Why nested comments use by some programming languages such as MATLAB ,I just want to know usage of this kind comments in a program and what are the advantages we can gain by using this nested comments ?
Kelum
  • 1,745
  • 5
  • 24
  • 45
3
votes
1 answer

How do you display the Disqus comment count in two places on the same page/post?

I placed the Disqus comment count in two separate places on my post pages. One comment count is below my post title and the other is in a floating div off to the left of my post body. The comment count only appears one time (only in the floating div…
StPhotina
  • 31
  • 1
  • 5
3
votes
1 answer

Remove comments from JSON data

I need to remove all /*...*/ style comments from JSON data. How do I do it with regular expressions so that string values like this { "propName": "Hello \" /* hi */ there." } remain unchanged?
Desmond Hume
  • 8,037
  • 14
  • 65
  • 112
3
votes
2 answers

VIM : Trouble mapping and re-selecting visual selection?

I am using a vim plugin called tComment It allows me to comment a line by pressing gc or Also, it works on the shortcut but the visual selection is lost. So, I tried: To make it work on single To retain the visual…
Yugal Jindle
  • 44,057
  • 43
  • 129
  • 197
3
votes
1 answer

What does a # in a comment between class and method mean?

I've started to see class + method references in comments and documentation etc written as: MyClass#myMethod i.e. with a # between the class and method. Is this some sort of coding standard/convention?
Kong
  • 8,792
  • 15
  • 68
  • 98
3
votes
4 answers

Remove duplicated comments in Wordpress?

Anyone know sql query or wordpress plugin which may help me to remove duplicate comments. While I was importing posts, comments into wordpress, i got some timeouts, and repeated process, so some of comments posted twice.
Mezelderz
  • 131
  • 2
  • 11
3
votes
1 answer

Newline or space/tab in JavaScript source makes a difference? (even in comment!?)

I always assumed that all whitespace (spaces, tabs, newlines) in JavaScript source code was 'equal', i.e. they're all valid to separate language elements such as identifiers, keywords, operators, etc. However, I noticed a strange difference between…
Rogier
  • 153
  • 5
1 2 3
99
100