4 ms·
Comments in code are like sex. When they are good its incredible, when they are bad it’s better than nothing
by wombatpm 6y ago
Comments in code are like sex. When they are good its incredible, when they are bad it’s better than nothing
- blippage 6y agoSex is like a game of Bridge. If you don't have a good partner, then you'd better have a strong hand.
- samus 6y agoThe difference to sex is that comments are unnecessary if the project is in good shape otherwise. Yes, no code is really self-documenting, but requirements documents, handbooks, documentation comments, VCS logs and tests should make it possible to elucidate weird code parts. Bad comments are detrimental: some are outdated comments that were forgotten to remove or to update, and others were wrong or misleading to begin with. Some are just redundant (they might state the obvious) and might become misleading later on. Their existence is of historical interest in the best case.
- munk-a 6y agoWhen comments are bad they can be actively misleading and when comments are everywhere they can do nothing but obscure logic. I like well commented code, but poorly commented code can be worse than uncommented code that's clearly written. Lastly, adding comments to code doesn't always add value.