Really? Yuk? I think over-commenting is bad too, but using a
consistent format like javadoc and documenting all functions and
variables in a *PUBLIC API* sounds good to me too. We do that where I
work in the header files, and it is quite helpful. Yes it is an issue
keeping the comments in sync with the usage. Code reviews should
catch that you'd hope -- at least when I review I look carefully at
the comments as well.
I guess I'd rather count on good comments than on someones notion of
what is obvious in terms of variable names and function names. Yes,
in some ideal world the names are so good and the code so clear and
the maintainer (who isn't usually the writer) has the same language
and domain knowledge and assumptions as the writer. But for the rest
of the time it is nice to have some hints, even if sometimes
redundant. And at least the comments are in the code, unlike say the
design document (if there even is one) which tends to get MORE out of
sync with the code unless one is quite careful.
All IMHO of course, and there is a happy medium. Too many comments,
and truly inane comments, makes the code harder to digest as well.
-David