|
|
|
|
|
by astrodust
5000 days ago
|
|
Comments regarding methods should be added to clarify how they are intended to be used, and what the results should be expected to be. Comments within the code should be used to highlight things that are not what they seem. They should answer any "WTF?" questions that naturally arise. A typical example is something like "Hack: Need to pass fifth argument as -1 to avoid crash in broken library". Comments that act like descriptive audio are useless. |
|
As I mentioned before, it seems the number of people who can actually pull off good comments are exceedingly small. I've looked at some prolific open source projects that have a decent amount commenting around method definitions as you suggest is good practice, but found the comments to be no more enlightening than just looking at the source code itself. I will assume they were just poor examples.
I do agree with everything else you said though.