I do believe that light commenting is good.
In your bullets, you make the following points:
helps clarify the problem before coding
Yes, but sometimes these notes should be kept separate as design documentation. Some of this can also be done by writing tests.
Here you are saying they have served their purpose already; you need another purpose to shove them into the code.
reminds you ... what you thought you were doing.
This is true, but it is could also true of the code itself.
This can also be done with tests.
[make] obvious that there's a mismatch between what was intended and what's been written
No, this is like having two compasses that don't agree. Well, if you're the author, it can work until tickling your memory doesn't help.
Expressing your intentions for some code can be more precisely done by tests.
make you to consider edge conditions and check [them]
Better done by testing.
require you to express and examine assumptions.
Better done by testing.
justify and document the choice of algorithm or method.
leave notes on things which were not obvious when you worked out what needed to be done or how to do it
What is being done and how it is being done is captured
in the code; the mindset of a maintainer with the artifact
of the code before him may not mirror that of the writer
who sat down with no code in front of him.
and so on.
May your comments not be so vague, :-)
and testing will probably help with whatever this is :-).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||