Don’t be a commenting idiot
March 19th, 2006 by greg
All too often I see code that is commented like this:
/* Function: foo foo does baz to bar */ int foo(int bar);
This is stupid. It is obvious that the documentation block is describing the foo function. This type of commenting is extremely common and I don’t understand why programmers feel compelled to waste their time like this. I’ve seen this practice required in coding standards! The only time this practice could be considered acceptable is if you are using a documentation extraction tool that can not parse your language. If you are using a tool like that you ought to use something better (or write your own, it’s not that hard). Java has javadoc, for C and C++ there’s Doxygen.
This entry was posted on Sunday, March 19th, 2006 at 8:04 pm and is filed under Code. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

April 1st, 2006 at 6:09 pm
[...] I’ve already written about one coding pet peave but I felt that I should share a few more. [...]