Hacker News new | ask | show | jobs
by tentonova 6008 days ago
However, if someone is over-commenting (which is possible in my opinion), chances are that it's because they believe that what they are doing is correct.

I've yet to work with anyone outside of an undergraduate class that over-commented their code.

It takes effort to over-comment code, and those that do are invariably writing both poor code and poor comments.

A much more prevalent malaise is that of developers with an unduly high opinion of their code's readability grossly under-commenting their code. This increases the long-term maintenance overhead and sometimes leads to forced rewrites by follow-up maintainers (which may be the author himself).

1 comments

You and I have different experiences then. I've seen people who comment everything and anything. And I know I'm not the only person who has seen this:

http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.htm...

And since it's Steve Yegge, it must be right?

His "over-commented" example is clearly extreme hyperbole.

His under-commented counter-example is extremely poorly commented code which fails to explain the "why", ensuring that nobody can make sense of the code path without actually stopping to read the entire expression and possibly the expressions to which it refers.