Click here to Skip to main content
16,009,318 members

Survey Results

What's more important - easily understandable code or good comments?   [Edit]

Survey period: 1 Sep 2003 to 7 Sep 2003

You would hope to get both, but given a choice, which would you take?

OptionVotes% 
Easily understandable code69066.60
Good comments34633.40



 
GeneralDan Saks, Sec'ty of the ANSI/ICO C++ committee, on comments Pin
Gary Wheeler2-Sep-03 6:02
Gary Wheeler2-Sep-03 6:02 
GeneralRe: Dan Saks, Sec'ty of the ANSI/ICO C++ committee, on comments Pin
leppie2-Sep-03 7:16
leppie2-Sep-03 7:16 
GeneralRe: Dan Saks, Sec'ty of the ANSI/ICO C++ committee, on comments Pin
Navin2-Sep-03 9:06
Navin2-Sep-03 9:06 
GeneralRe: Dan Saks, Sec'ty of the ANSI/ICO C++ committee, on comments Pin
Navin2-Sep-03 9:05
Navin2-Sep-03 9:05 
GeneralRe: Dan Saks, Sec'ty of the ANSI/ICO C++ committee, on comments Pin
Gary Wheeler2-Sep-03 9:17
Gary Wheeler2-Sep-03 9:17 
GeneralDocumentation is like sex... Pin
Steven J. Ackerman2-Sep-03 5:14
Steven J. Ackerman2-Sep-03 5:14 
GeneralRe: Documentation is like sex... Pin
Gary Wheeler2-Sep-03 6:27
Gary Wheeler2-Sep-03 6:27 
GeneralDepends on the code you're writing. Pin
Navin2-Sep-03 4:55
Navin2-Sep-03 4:55 
... and who will be maintaining it. If the purpose of the code is clear (e.g., you know it's a GUI app that does blah), then well-written code is better than comments.

However if it does something that someone maintaing the code might not easily understand (e.g., drivers, system code, or mathmatecal solvers), then comments are better, because if the reasons behind doing something aren't understood, then the best written code in the world won't help.

So I guess in summary: well-written code can say what is being done, but only comments can say why it is being done.

However more often than not, it's probably the "what" that's important.



"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
GeneralBad Language Pin
Gavin Greig2-Sep-03 3:42
Gavin Greig2-Sep-03 3:42 
GeneralRe: Bad Language Pin
Navin2-Sep-03 5:35
Navin2-Sep-03 5:35 
GeneralRe: Bad Language Pin
ColinDavies2-Sep-03 22:42
ColinDavies2-Sep-03 22:42 
GeneralRe: Bad Language Pin
Gavin Greig2-Sep-03 23:07
Gavin Greig2-Sep-03 23:07 
GeneralThis code sure is legible eh? Pin
Nish Nishant1-Sep-03 19:06
sitebuilderNish Nishant1-Sep-03 19:06 
GeneralRe: This code sure is legible eh? Pin
Matt Newman2-Sep-03 2:34
Matt Newman2-Sep-03 2:34 
GeneralRe: This code sure is legible eh? Pin
Navin2-Sep-03 5:36
Navin2-Sep-03 5:36 
GeneralRe: This code sure is legible eh? Pin
Taka Muraoka2-Sep-03 7:33
Taka Muraoka2-Sep-03 7:33 
GeneralRe: This code sure is legible eh? Pin
Gary Wheeler2-Sep-03 5:52
Gary Wheeler2-Sep-03 5:52 
GeneralBoth are important... Pin
J. Dunlap1-Sep-03 18:21
J. Dunlap1-Sep-03 18:21 
GeneralRe: Both are important... Pin
Matt Newman2-Sep-03 2:35
Matt Newman2-Sep-03 2:35 
GeneralSame thing Pin
Jim A. Johnson1-Sep-03 16:25
Jim A. Johnson1-Sep-03 16:25 
GeneralRe: Same thing Pin
Chris Maunder1-Sep-03 16:54
cofounderChris Maunder1-Sep-03 16:54 
GeneralRe: Same thing Pin
berndg1-Sep-03 20:16
berndg1-Sep-03 20:16 
GeneralRe: Same thing Pin
Chris Beckett2-Sep-03 3:57
Chris Beckett2-Sep-03 3:57 
GeneralRe: Same thing Pin
leppie2-Sep-03 7:46
leppie2-Sep-03 7:46 
GeneralRe: Same thing Pin
John M. Drescher2-Sep-03 16:05
John M. Drescher2-Sep-03 16:05 

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.