code-comments

What are your "hard rules" about commenting your code?

I have seen the other questions but I am still not satisfied with the way this subject is covered. I would like to extract a distiled list of things to check on comments at a code inspection. I am sure people will say things that will just cancel each other. But hey, maybe we can build a list for each camp. For the guys who don't comm...

What is your personal approach/take on commenting?

Duplicate What are your hard rules about commenting? A Developer I work with had some things to say about commenting that were interesting to me (see below). What is your personal approach/take on commenting? "I don't add comments to code unless its a simple heading or there's a platform-bug or a necessary work-around ...

Maintenance commenting

What special techniques you use when modifying existing code? Eg: Say you modify a business rule inside a method. Do you mark the modified section with special comments? Any coding/commenting standards you use when modifying code? ...

How do you comment a Perl regular expression?

How do you put comments inside a Perl regular expression? ...

Comments in source code

How to keep the source code well documented/commented? Is there a tool to generate a skeleton for comments on the Unix platform for C++? In general, how many lines of comments is recommended for a file with around 100 lines of code? ...

PHP/C/C++ - How does your initial comment block look in your programs?

I am on a large project, and have not really made any comment 'headers' in my program yet. I just started using SVN for the project the other day. I want to add the SVN tag $id$, but have not decided on any standard commenting. So, my question to everyone here, is how does your initial comment block look in all your programs? i.e: /...

Use Powershell to print out line number of code matching a RegEx

I think we have a bunch of commented out code in our source, and rather than delete it immediately, we've just left it. Now I would like to do some cleanup. So assuming that I have a good enough RegEx to find comments (the RegEx below is simple and I could expand on it based on our coding standards), how do I take the results of the fi...

Confirm ASP.NET website binaries do not change after adding comments in source

A member of my project team needs to add source code comments to many of his ASP.NET projects to provide better documentation. Some members of the project team recommend that we conduct thorough regression testing if we add any source code comments since there is a remote chance that some of the source code might inadvertently get comme...

Should I use comments in code, liberally?

All, To comment liberally or not to?? Pros and Cons. I personally prefer commenting as it leaves nothing to the fancies of the people reading it. Thanks ...

Remove specified text from beginning of lines only if present (C#)

I have a textbox in which the user can edit text, in a scripting language. I've figured out how to let the user comment out lines in one click, but can't seem to figure out how to uncomment properly. For example, if the box has: Normal Text is here More normal text -- Commented text -- More commented text Normal Text again --Commented ...

"Live" Changelogging for CVS-Comments?

Hello, My problem is that i often forgot what i have changed in my software, when i do a cvs-check in. So i have to lookup my code for changes. If this could be automated, it would be great. So can anyone tell me if there is a tool or something which can lookup my code (i'm using c#) for specific comments, that i add if i change someth...

recommended commenting tool / add-in for Visual Studio >

Which tools you use and why for automatic documentation / comments generation with Visual Studio ...

How do you add comments to mysql queries, so they show in logs?

I wanna be able to add a little note, at the beginning of each query, so when I see it in the processlist, or "mytop", I can tell where its running. Is something like this possible? ...

Why do /**/ comments work in stylesheets but // comments don't?

Is there a good reason for this? Lame question, but I just wondered if there was a reason why. ...

If we have too much commented code in .net would it effect code performance?

if we have too much commented code in .net would it effect code performance? ...

HTML table to “graphical text” for code comments

Is there a tool (ideally command-line-based) that can help in converting the source to HTML tables into “graphical text” (think perhaps ASCII art for HTML tables) for use in code comments, as show below? For example, given the following HTML table source <TABLE BORDER=1> <CAPTION>A test table with merged cells</CAPTION> <TR><TH ROW...

Source Control Checkin Comments at Top Of Source Files

I've noticed a discrepancy with some source files in our system whereby some contain source-control checkin comments, and some do not. These comments are added automatically to the top of the file when it is checked in: * $Log: //vm1/Projects/Morpheus/Sleep.bdy-arc $ -- -- Rev 1.14 Apr 14 2009 15:32:52 John Smith --Fixed bu...

Should .net comments start with a capital letter and end with a period?

Depending on the feedback I get, I might raise this "standard" with my colleagues. This might become a custom StyleCop rule. is there one written already? So, Stylecop already dictates this for summary, param, and return documentation tags. Do you think it makes sense to demand the same from comments? On related note: if a comment is ...

Access attributes/methods comments programmatically in Ruby

Is there a way for programmatically accessing a method comments? or an attribute comments? I would like to use it as a description for the method in a documentation which I don't want to be static or generated with rdoc or equivalent. Here is an example of a Ruby class: Class MyClass ## # This method tries over and over until it i...

VSDoc alternative?

VSDoc is an awesome way of commenting Javascript, and I particularly like the ability to make one Javascript file 'depend' on another. This paves the way for Javascript minifiers/combiners that take into account proper ordering of script includes. The only thing that might bother some is that it's VS-Doc. Are there any competing format...