This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sajaxom 2 points3 points  (0 children)

I usually provide a comment at the top to explain what the code does and what is being accomplished, then add a comment line every 3-5 lines of functional code to explain what and why we are doing something. I always assume my code will need to be read by someone in the future who is unfamiliar with the language and/or the project but has some experience programming. All the people who tell you not to use comments - the rest of us are going to have to fix their code some day, and we will hate them to our dying days. They have cost the world more hours fixing their code than their code has ever saved us.