Professional Documents
Culture Documents
Comments
Comments
Comments
Muhammad Uzair
What are Comments?
A comment is a text note added to source code to
provide explanatory information, usually about
the function of the code.
To Comment or Not to Comment
//RIPJSB 1750
If your comment causes confusion instead
of dispelling it, remove it.
Rule 5: Provide links to the original source of
copied code
Rule 6: Add comments when fixing bugs
Comments should be added not just when initially
writing code but also when modifying it,
especially fixing bugs.
It not only help the reader but also help the
testers that how to test the code if a specific bug
is found.
Example: // Use the name as the title if the
properties did not include one (issue #1425)
Rule 7: Avoid endline comments for
multiple lines of code