Code Comments Practices
Discussions debate the purpose and best practices for code comments, emphasizing that they should explain 'why' the code behaves a certain way rather than 'what' it does, versus self-documenting code.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Can't you just add comments to the actual code saying those things? I've seen code comments saying those exact things.
In general, I feel comments should explain why the code is the way it is, not what it does.
commenting is not a good replacement for cleaner code, because they can drift and lie.
You must be doing comments wrong. If they explain the why, they should still be relevant. Or people should rewrite them when they adjust the code...
Never. Comments should clarify what code does or why it does what it does. Nothing else.
I think the saying is that comments explain why the code does something.
Comments aren't for "what does this code do?", they are for "why does this code do this?".
Don't like my comments in my code? Don't read 'em. They're useful to some people.
You seem to be missing the point of comments. Comments are not meant to explain what your code does. They are for explaining why.
Good code should have some comments. Not for the "what" but for the "why".