I tend to comment for the why more for the what. We read and maintain code far more than we write it so I lean on the why, it also helps in the life cycle of the comment itself. If you refactor the section below the comment, the comment itself can still be valid.
I tend to comment for the why more for the what. We read and maintain code far more than we write it so I lean on the why, it also helps in the life cycle of the comment itself. If you refactor the section below the comment, the comment itself can still be valid.
That's very true. As software developers, we spend a lot of time maintaining or enhancing existing code. I agree, comments can help there.