Comment Comment first (Score 1) 580
I actually comment the main parts of my code before I write the code. Reason being is I like to get the general layout of the code down first and then add further comments as I go along to explain my reasoning *to me*.
I don't know how long it's going to be before I come back to a piece of code and nothing annoys me more than having mental clutter in my mind. I don't want to have to *remember* what why or how certain bit of code does what it does. I just want to pull up my code and explain it to myself and say "thanks me of the past for considering me today". Coders that don't explain what they are doing in their code are just hard to work with.
Well commented code helps code look beautiful and flow like poetry. When you look at code you can see almost immediately if it is going to be painful to modify. I try to put as much back onto the machine as I can, like using database design tools so I don't have to keep stuff in my mind.
I use Nassi-Shneiderman mixed with pseudo-code on paper to do a design (I'm getting better at UML tools - so soon I hope to upgrade this part of my coding practise) and when I'm happy with that I move to comment before writing the actual functional parts of code, increasing the detail of the comments as I go along. I used to be shy about my code but now I'd be embarrassed if I didn't comment my code - because it's not polite to my colleagues. Comments mean I don't have to waste time trying to remember where I was up to as it's simple for me to compare it with my design and away I go.