Hacker News new | past | comments | ask | show | jobs | submit login

I disagree that it "ends being far worse than having no comments at all". I think it's still helpful: 1) still provides the visual boundary for the following chunk of code 2) still tells me that the code has something to do with scroll bars

As they say, "Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing" :-)

Yeah, it could trick me, but this is no different to any other types of sloppiness.

Should we stop giving meaningful names to variables and functions, because some developer can change what a function does, or variable represents, but fail to update the names to reflect the fact?

Most of the time when I have to look at the code with out of date comments, after paying some initial "tax" of confusion and lost time, it becomes clear that the comment is out of date(git helps with this, too). So I take time and fix the comment. Or in rare cases when I still don't understand what the comment should say, I put a "FIXME: out of date comment" above the offending line.

One thing I give you: when reading code, I find comments explaining why the code does X, more useful than comments stating the the code does X...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: