Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think it may be possible for all of the following to be true:

1. Comments explaining the 'why' can be helpful.

2. However, due to their inherent DRY violation, comments may become out of sync with the code and impose maintenance costs.

3. The value of comments still outweighs their maintenance costs.

That is to say, an example of a misleading comment doesn't necessarily prove that comments are bad in general. The converse may also be true, however. I no longer have a strong stand on this issue. I try to generally go with whatever commenting style the project I'm on uses, though I also have been known to write the occasional long descriptive pre-amble.



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

Search: