Click here to Skip to main content
15,887,465 members

Survey Results

Is the way source code looks as important as how it runs?   [Edit]

Survey period: 29 Jul 2002 to 4 Aug 2002

Some people are code formatting nuts while others feel that as long as it's tight it's good enough. What's your opinion?

OptionVotes% 
Formatting is most important because nothing's worth doing if you don't look good doing it.756.22
Formatting is important because it makes optimisation, bug fixing etc. easier.64453.44
They are both equally important.34328.46
Performance over good looks. The user doesn't see the code.1068.80
It was hard to write so it should be even harder to read.221.83
I really don't care.151.24



 
GeneralRe: If it looks bad, it most likely runs bad as well... Pin
Mike Pulice30-Jul-02 12:06
Mike Pulice30-Jul-02 12:06 
GeneralRe: If it looks bad, it most likely runs bad as well... Pin
SHaroz1-Aug-02 12:42
SHaroz1-Aug-02 12:42 
GeneralRe: If it looks bad, it most likely runs bad as well... Pin
jan larsen2-Aug-02 2:12
jan larsen2-Aug-02 2:12 
GeneralRe: If it looks bad, it most likely runs bad as well... Pin
Paul Watson2-Aug-02 6:20
sitebuilderPaul Watson2-Aug-02 6:20 
GeneralI am a zealot Pin
Christian Graus28-Jul-02 19:51
protectorChristian Graus28-Jul-02 19:51 
GeneralRe: I am a zealot Pin
James T. Johnson28-Jul-02 20:06
James T. Johnson28-Jul-02 20:06 
GeneralRe: I am a zealot Pin
Christian Graus28-Jul-02 20:19
protectorChristian Graus28-Jul-02 20:19 
GeneralRe: I am a zealot Pin
James T. Johnson28-Jul-02 21:12
James T. Johnson28-Jul-02 21:12 
Christian Graus wrote:
I think you missed my point.

Probably Wink | ;)

Christian Graus wrote:
I hope you're being ironic.... A major reason I hate all that casting is that C# is hard to read at times because it's too verbose.

I don't find it that hard to read; but it depends on how you are doing it.

If I have to cast, I prefer to store the result in a variable so I don't have to cast again.

I also prefer to have only one or two member access per line.

Not my style
((BarRow) ((Foo) fooCollection[4]).Rows[3]).Baz();

My style
Foo foo = (Foo) fooCollection[4];<br />
BarRow barRow = (BarRow) foo.Rows[3];<br />
<br />
barRow.Baz();


Which I think is the kind of formatting vs performance that the survey was asking about. Here a few cycles are wasted because it stores the results of each line in a variable; only to be used once.

I would think that a good optimizing compiler would see that this is the case so it would compile down to the better version; but I've seen weird bugs with the VC6 optimizer (a simple 'center in window' type function was messed up).

James
"Java is free - and worth every penny." - Christian Graus
GeneralRe: I am a zealot Pin
Tomasz Sowinski29-Jul-02 1:11
Tomasz Sowinski29-Jul-02 1:11 
GeneralRe: I am a zealot Pin
Christian Graus29-Jul-02 1:40
protectorChristian Graus29-Jul-02 1:40 
GeneralRe: I am a zealot Pin
Joe Sonderegger29-Jul-02 1:32
Joe Sonderegger29-Jul-02 1:32 
GeneralRe: I am a zealot Pin
Mauro Gagna29-Jul-02 11:59
Mauro Gagna29-Jul-02 11:59 
GeneralRe: I am a zealot Pin
Mike Klimentiev29-Jul-02 8:53
Mike Klimentiev29-Jul-02 8:53 
GeneralRe: I am a zealot Pin
Christian Graus29-Jul-02 12:32
protectorChristian Graus29-Jul-02 12:32 
GeneralRe: I am a zealot Pin
Kastellanos Nikos28-Jul-02 20:41
Kastellanos Nikos28-Jul-02 20:41 
GeneralRe: I am a zealot Pin
Roger Wright29-Jul-02 4:08
professionalRoger Wright29-Jul-02 4:08 
GeneralRe: I am a zealot Pin
Christian Graus29-Jul-02 12:33
protectorChristian Graus29-Jul-02 12:33 
GeneralRe: I am a zealot Pin
Roger Wright29-Jul-02 19:54
professionalRoger Wright29-Jul-02 19:54 
GeneralRe: I am a zealot Pin
James R. Twine29-Jul-02 4:55
James R. Twine29-Jul-02 4:55 
GeneralRe: I am a zealot Pin
Christian Graus29-Jul-02 12:34
protectorChristian Graus29-Jul-02 12:34 
GeneralRe: I am a zealot Pin
James R. Twine29-Jul-02 18:53
James R. Twine29-Jul-02 18:53 
GeneralRe: I am a zealot Pin
Mike Pulice30-Jul-02 12:09
Mike Pulice30-Jul-02 12:09 
GeneralRe: I am a zealot Pin
Christian Graus30-Jul-02 12:35
protectorChristian Graus30-Jul-02 12:35 
GeneralOf course, it really depends on the situation... Pin
Shog928-Jul-02 18:17
sitebuilderShog928-Jul-02 18:17 
GeneralRe: Of course, it really depends on the situation... Pin
Mr Morden28-Jul-02 21:09
Mr Morden28-Jul-02 21:09 

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.