I comment rather sparsely. My coding style emphasizes clarity, so comments usually do more harm than good unless I'm explaining my reasoning behind some code and not it's mechanics.
I comment rather sparsely. My coding style emphasizes clarity, so comments usually do more harm than good unless I'm explaining my reasoning behind some code and not it's mechanics.
My best code is written with the delete key.
I do comment on a 1 line of code 1 line of comment base. Not for every line, but it evens out at function/class level.I put the 1-1 comment in there just for laughs... but I guess we do have those kinda people
If you deleted all source from my code, you could still see the structure and recode it.
Those comments have saved me a lot of work and I never had to think twice about what a function does when I had to dig into a project 3 years later.
I don't think there can be "too much" comment. If anyone else is bothered by the amount, s/he can delete it. But if it's not enough, no one will be able to pull some explanations out of thin air 5 years later.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
if i dont comment my own programs, big or small, then i almost always forget what im doing