Click here to Skip to main content
15,890,282 members

Survey Results

Do you comment your code?   [Edit]

Survey period: 19 Jul 2010 to 26 Jul 2010

Some preach that good code requires no comments, while others preach that (good) comments can be as valuable as the code itself. On which part of the spectrum do you lie?

OptionVotes% 
I add comment headers for all public classes, objects and methods, events, fields etc36244.15
I add comment headers for all non-public classes, objects and methods, as well as non-obvious logic inside these24630.00
I provide comments at the top of files17821.71
I comment any code that may be obscure (the "what") to a reader51162.32
I comment any code where the purpose (the "why") may be obscure54466.34
I comment on expected inputs, outputs and other results17621.46
I comment on exceptions, side effects or error codes20525.00
I comment on structures (loop endings, function endings etc)10713.05
I comment as a last resort when I can't make my code any clearer22227.07
I do not comment code.465.61
Respondents were allowed to choose more than one answer; totals may not add up to 100%

View optional text answers (45 answers)


 
GeneralRe: Interesting options... Pin
The Man from U.N.C.L.E.18-Jul-10 22:55
The Man from U.N.C.L.E.18-Jul-10 22:55 
GeneralRe: Interesting options... Pin
Niklas L18-Jul-10 23:08
Niklas L18-Jul-10 23:08 
GeneralRe: Interesting options... Pin
codemunkeh19-Jul-10 13:30
codemunkeh19-Jul-10 13:30 
GeneralWhen client asked for it :) Pin
Noman Aftab18-Jul-10 21:25
Noman Aftab18-Jul-10 21:25 
GeneralVery good question this week Pin
Johnny J.18-Jul-10 20:29
professionalJohnny J.18-Jul-10 20:29 
GeneralRe: Very good question this week Pin
hegdesrinivas19-Jul-10 0:53
hegdesrinivas19-Jul-10 0:53 
GeneralRe: Very good question this week Pin
peterchen19-Jul-10 2:07
peterchen19-Jul-10 2:07 
GeneralRe: Very good question this week [modified] Pin
thatraja19-Jul-10 5:36
professionalthatraja19-Jul-10 5:36 
Of course good question. But 10 12 21 27 people voted for "I do not comment code." D'Oh! | :doh:
thatraja

Tips/Tricks|Brainbench certifications|Facebook|Twitter
modified on Tuesday, July 20, 2010 9:49 AM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.