Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Commenting code..

  1. #1
    Senior Member
    Join Date
    Jan 2002
    Posts
    682

    Question 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 used to be With IT. But then they changed what IT was. Now what I'm with isn't IT, and what's IT seems scary and weird." - Abe Simpson

  2. #2
    Banned
    Join Date
    Oct 2001
    Posts
    1,459
    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

  3. #3
    Senior Member
    Join Date
    Jan 2002
    Posts
    682
    sure i get it...in a non-specific kind of way....
    I used to be With IT. But then they changed what IT was. Now what I'm with isn't IT, and what's IT seems scary and weird." - Abe Simpson

  4. #4
    all my code is javadoc friendly

  5. #5
    Senior Member
    Join Date
    Oct 2001
    Posts
    293
    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....
    zion1459
    Visit: http://www.cpc-net.org
    \"Software is like sex: it\'s better when it\'s free.\" -Linus Torvalds

  6. #6
    Senior Member
    Join Date
    Nov 2001
    Posts
    257
    I've generally got a comment for each function, rarely I'll have two or three if the function does something complex.
    -Shkuey
    Living life one line of error free code at a time.

  7. #7
    Member
    Join Date
    Aug 2001
    Posts
    69
    I do not add comments, until I get lost in my own code
    Then I start to add comments in specific places, like traffic polices...
    Try, Fail but Do iT at last!
    ASA The ZeroTimeR
    The Turkish IT Documentation Project

  8. #8
    Banned
    Join Date
    Mar 2002
    Posts
    968
    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.....

  9. #9
    Senior Member
    Join Date
    Aug 2001
    Posts
    356
    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.
    -8-

    There are 10 types of people in this world: those who understand binary, and those who dont.

  10. #10
    AntiOnline Senior Member souleman's Avatar
    Join Date
    Oct 2001
    Location
    Flint, MI
    Posts
    2,883
    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
    \"Ignorance is bliss....
    but only for your enemy\"
    -- souleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •