Hacker News new | ask | show | jobs
by 29athrowaway 1756 days ago
Well documented code is respectful of the maintainer's time. Nobody wants to read a monologue full of noise to understand what is happening.

Comments are not monologues. Explain what the line you are commenting does, and perhaps elaborate why. But always acknoweledge: more words = more patience required = more maintenance cost.

Also, nobody will care about what your name is in 2 years. Do not make the code about you.

1 comments

On the other hand, if something is missing in the comments, it could take days to find out exactly what you need. Maybe a "level of comments" like log levels could help here?
Making it easy to hide comments == making it easy to forget to update comments.
That's a good point. Maybe add a check if the function changed and the comment didn't to remind people? But comment are already easy to forget to update, as they are not code.