I have seen the other questions but I am still not satisfied with the way this subject is covered.
I would like to extract a distiled list of things
The comments you write can be revealing about the quality of your code. Countless times I've removed comments in my code to replace them with better, clearer code. For this I follow a couple of anti-commenting rules:
Those are really the same rule repeated for two different contexts.
The other, more normal rules I follow are:
There are no hard rules - hard rules lead to dogma and people generally follow dogma when they're not smart enough to think for themselves.
The guidelines I follow:
1/ Comments tell what is being done, code tells how it's being done - don't duplicate your effort.
2/ Comments should refer to blocks of code, not each line. That includes comments that explain whole files, whole functions or just a complicated snippet of code.
3/ If I think I'd come back in a year and not understand the code/comment combination then my comments aren't good enough yet.
I focus on the why. Because the what is often easy readable. TODO's are also great, they save a lot of time.
And i document interfaces (for example file formats).