Re:Golden rules for becoming a better programmer
by MaybiusStrip on Tuesday January 26, 2016 @09:09PM
(#10977754)
I like how Robert C. Martin puts it: before you write a comment, ask yourself whether you can write the code in a way that makes the comment unnecessary. If you cannot, then it is better to leave the comment than none at all.
[ Parent
| on HN ]
Re:Golden rules for becoming a better programmer
by mannykannot on Tuesday January 26, 2016 @11:08PM
(#10978139)
Fair enough, so long as you understand that programming languages are not expressive enough, in general, to clearly explain purpose and rationale. In these matters, providing a hint through identifier naming is not an adequate substitute for a clear explanation in a human language.
Re:Golden rules for becoming a better programmer
by roddux on Wednesday January 27, 2016 @06:08AM
(#10979437)
As an aside, clearly written code does a pretty good job of explaining what it does, but not why. Sometimes there will have been reasons for avoiding a particular method, which isn't made obvious by the code itself.