My 2 cents after reading Clean Code by Robert Martin and 2 years of experience.
TLDR: Minimize comments except for WHY questions.
Whenever i feel the urge to comment, I look at my code and try to think as if i never have seen it before. I generally have a checklist.
There's probably a couple more, but those are top of my head.
100% i comment for WHY. These tend to be exceptions that at first glance seem wierd to anyone who didn't see when it broke.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My 2 cents after reading Clean Code by Robert Martin and 2 years of experience.
TLDR: Minimize comments except for WHY questions.
Whenever i feel the urge to comment, I look at my code and try to think as if i never have seen it before. I generally have a checklist.
There's probably a couple more, but those are top of my head.
100% i comment for WHY. These tend to be exceptions that at first glance seem wierd to anyone who didn't see when it broke.