View Poll Results: Percentage of your program lines in comments?

Voters
24. You may not vote on this poll
  • 5%

    7 29.17%
  • 10%

    6 25.00%
  • 15%

    3 12.50%
  • 25%

    5 20.83%
  • What is a comment?

    1 4.17%
  • 1-1 (one comment per line of code)

    2 8.33%

Percent of comments in your code?

This is a discussion on Percent of comments in your code? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I comment rather sparsely. My coding style emphasizes clarity, so comments usually do more harm than good unless I'm explaining ...

  1. #16
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    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.

  2. #17
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    I put the 1-1 comment in there just for laughs... but I guess we do have those kinda people
    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.

    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.

  3. #18
    ---
    Join Date
    May 2004
    Posts
    1,379
    if i dont comment my own programs, big or small, then i almost always forget what im doing

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 23
    Last Post: 04-20-2009, 08:35 AM
  2. Seems like correct code, but results are not right...
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 01:33 PM
  3. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 06:06 PM
  4. code and comments check
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 01-17-2002, 12:45 PM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21