Leveraging synergy in this championship year
Michael Davies
Local
News
Software
Utility
Powered by PyBlosxom
Copyright © 2003, 2004, 2005, 2006, 2007, 2008 Michael Davies, |
Code Comments Aren't EvilStewart writes, "Comments Are Evil", most specifically, "Remember kids, comments in code are evil. They are wrong - or misleading at best". Unfortunately, this is wrong advice. Code comments can be misleading - they can do more harm than good. But I've seen both ends of the spectrum, the Ada-comment-every-line-describing-what-the-loc-does and the *nix kernel hacking idea of the-code-is-your-comments idea. Both are extremes and both are wrong, even though "the definitive record is the code itself". Code comments should:
Getting the level of commenting right is hard, especially if you haven't written much code, or if you are unfamiliar with the domain or the implementation language. But commenting done right can greatly assist yourself and others when you revisit that chunk of code - whether that be to find that heisenbug, or to add new functionality, or even just understand what you were trying to achieve back 3 weeks ago.
|
|
This web page is optimised
for standards. |