Click here to Skip to main content
15,920,383 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



 
GeneralRe: Neither Pin
ColinDavies3-Sep-03 10:32
ColinDavies3-Sep-03 10:32 
GeneralRe: Neither Pin
Paul Watson3-Sep-03 20:35
sitebuilderPaul Watson3-Sep-03 20:35 
GeneralRe: Neither Pin
ColinDavies3-Sep-03 21:17
ColinDavies3-Sep-03 21:17 
GeneralRe: Neither Pin
FruitBatInShades3-Sep-03 23:56
FruitBatInShades3-Sep-03 23:56 
GeneralRe: Neither Pin
ColinDavies4-Sep-03 0:50
ColinDavies4-Sep-03 0:50 
GeneralRe: Neither Pin
FruitBatInShades4-Sep-03 1:06
FruitBatInShades4-Sep-03 1:06 
GeneralRe: Neither Pin
ColinDavies4-Sep-03 1:33
ColinDavies4-Sep-03 1:33 
GeneralRe: Neither Pin
Paul Oss4-Sep-03 12:22
Paul Oss4-Sep-03 12:22 
Colin Davies wrote:
If a solution is required, it doesn't matter if it is created in C++. C# VB, Pascal, Forth, Lisp, or Lego. What matters is if it meets the requirements of the client. Commenting and creating understandable code is a micro issue.

I respectfully disagree. I think it *may* depend on your range of experience, environment, level of co-workers (co-workers are often like your family: you can't choose them)

My experience says otherwise. I worked in a shop where we spent several years getting out from under several things:

Bad code design
Slapdash technique
Difficult to understand and maintain code.

There were times, (I sh*t you not) where what could have been done in 10 to 15 lines of code, had been done in 40 pages of code-- no comments.

No, difficult to understand code by itself is not often THE issue, but it can be a major factor. If I am doing a debug of a program, I don't step through every line of code. My employer couldn't afford it. I need to look at blocks of code, get the gist of what's going on, and eventually I'll zero in on the pertinent sections. Broad comments can help eliminate entire sections/functions very quickly.

If you've been lucky/fortunate to work in an office with highly compitent co-workers (or you work in a one man shop) readability and understandability are going to drop sharply on the list of 'must haves' because you're not speaking to a very wide audience.

Where I think your complaint can be legitimate, is corporations which get bitten by the beaurocracy bug want to institute some kind of hard line structure comments which end up taking as much time to puzzle out as the original code does. I can't agree more that this often becomes a process in and of itself thus causing you to add time to the top of the process that you cut from the bottom.

Comments or understandable code don't have to become a chore. IN the case of comments, a simple sentence can help eliminate a section of code.

//Get patient master record from database, parse.

And if the programmer is looking for the part of the code which prints the patient statement, he knows he doesn't have to puzzle out what's going on here, he can move on.

Is there a perfect system? Hell no. But I can tell you from experience, that our development time dramatically reduced once we added just a few INFORMAL practices. Again, we didn't move to some kind of god awful AT&T Bell Labs style UML IEEE documentation system. Just a few informal rules of thumb, and you can eliminate a lot of tripwires and traps in the future.

Paul
GeneralRe: Neither Pin
ColinDavies4-Sep-03 17:26
ColinDavies4-Sep-03 17:26 
GeneralRe: Neither Pin
Paul Oss4-Sep-03 20:43
Paul Oss4-Sep-03 20:43 
GeneralRe: Neither Pin
Renault the Duck5-Sep-03 17:30
Renault the Duck5-Sep-03 17:30 
GeneralRe: Neither Pin
Paul Oss5-Sep-03 20:19
Paul Oss5-Sep-03 20:19 
GeneralRe: Neither Pin
Jim A. Johnson3-Sep-03 8:18
Jim A. Johnson3-Sep-03 8:18 
GeneralRe: Neither Pin
ColinDavies3-Sep-03 10:13
ColinDavies3-Sep-03 10:13 
GeneralRe: Neither Pin
Paul Oss4-Sep-03 12:28
Paul Oss4-Sep-03 12:28 
GeneralRe: Neither Pin
Steffen Büchner3-Sep-03 20:24
Steffen Büchner3-Sep-03 20:24 
GeneralRe: Neither Pin
brianwelsch3-Sep-03 9:59
brianwelsch3-Sep-03 9:59 
GeneralRe: Neither Pin
ColinDavies3-Sep-03 10:18
ColinDavies3-Sep-03 10:18 
GeneralRe: Neither Pin
brianwelsch3-Sep-03 10:26
brianwelsch3-Sep-03 10:26 
GeneralRe: Neither Pin
Gary Wheeler3-Sep-03 10:04
Gary Wheeler3-Sep-03 10:04 
GeneralRe: Neither Pin
ColinDavies3-Sep-03 10:19
ColinDavies3-Sep-03 10:19 
GeneralRe: Neither Pin
Gary Wheeler3-Sep-03 10:40
Gary Wheeler3-Sep-03 10:40 
GeneralRe: Neither Pin
ColinDavies3-Sep-03 11:18
ColinDavies3-Sep-03 11:18 
GeneralRe: Neither Pin
Gary R. Wheeler3-Sep-03 12:32
Gary R. Wheeler3-Sep-03 12:32 
GeneralRe: Neither Pin
brianwelsch3-Sep-03 15:21
brianwelsch3-Sep-03 15:21 

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.