-
Commenting code..
So this isn't sec related...but i expect a lot of you have opinions...
what are your strategies for commenting code...i find my strategy sucks...i never seem to "have the time" to do it...but gah...what a pain in the butt to go back without comments...do you comment at all...do you do it on the fly or after you've completed a module/procedure/whatever...
-
I put in non-specific comments in my code.... Just saying this is this, thta is that and if you change this or that then this will happen to that... I hope someone gets that :confused:
-
sure i get it...in a non-specific kind of way.... :p
-
all my code is javadoc friendly
-
I always try to make my functions small and easy to understand when reading the code... But I still add comments at the start of each function explaining what they do and through out the function what is happening... I don't comment normal if-sentences but often things as loops. Things which might not be to easy to understand. My main function/program (whatever u wanna call it) is then just a listing of all other functions (of course)... I explain most of my code by using logical var-names etc....
-
I've generally got a comment for each function, rarely I'll have two or three if the function does something complex.
-
I do not add comments, until I get lost in my own code :D
Then I start to add comments in specific places, like traffic polices...
:hiphop: :smokes:
-
I put comments as I go, to explain what certain tags or variables are for/do what. But if I get into a coding spurt, I tend to leave them out.....
It usually depends what/who I am coding for.....
-
i comment as i go. my basic rule of thumb is that if i cant immeadiatly understand what a loop or whatever is doing add a comment. also i always have a comment before each function, and comments at the end of nested loops/if statements to keep it as clear as possible.
-
Well, I always talk to myself and make comments when I am coding. Maybe thats the reason my office mate won't let me start up a compiler any more :(