Quote:
Originally Posted by aeastet
There is no such thing as too many comments. You have to remember that you will not always be there to explain what you were thinking.
|
Comments that tell
what a block of code does are good, as long as they don't get into too much detail. Comments that describe
why the code does something are important. Comments that explain
how it works at a high level are fine.
But comments that just duplicate the code in paraphrase do not help, and they can actively hurt if they fall out of sync with programming changes.
Quote:
|
I have never seen code with too many comments. I don't believe that is possible.
|
I have seen code with too many comments. It was like
Code:
ACHK EQU * ; check if ASCII input is a letter
LDA CNV ; get the configuration value in the accumulator
SUB #64 ; subtract 64
BLT SKIP2 ; skip if less than zero
...
The first line's comment is helpful, describing what the routine is intended to do. The rest of the line-by-line commentary adds absolutely no information. It serves only to clutter the source code.