Click here to Skip to main content
15,897,187 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: VS 7 IDE speed Pin
Anna-Jayne Metcalfe4-Aug-02 12:52
Anna-Jayne Metcalfe4-Aug-02 12:52 
GeneralRe: VS 7 IDE speed Pin
Marc Clifton31-Jul-02 11:42
mvaMarc Clifton31-Jul-02 11:42 
GeneralRe: VS 7 IDE speed Pin
Pavel Sokolov31-Jul-02 12:13
Pavel Sokolov31-Jul-02 12:13 
GeneralRe: VS 7 IDE speed Pin
Jim A. Johnson31-Jul-02 12:33
Jim A. Johnson31-Jul-02 12:33 
GeneralRe: VS 7 IDE speed Pin
paulccc2-Aug-02 7:05
paulccc2-Aug-02 7:05 
GeneralRe: VS 7 IDE speed Pin
Pavel Sokolov2-Aug-02 8:52
Pavel Sokolov2-Aug-02 8:52 
GeneralRe: VS 7 IDE speed Pin
Pavel Sokolov2-Aug-02 8:54
Pavel Sokolov2-Aug-02 8:54 
GeneralRe: VS 7 IDE speed Pin
Jason.King.Work@gmail.com2-Aug-02 9:21
Jason.King.Work@gmail.com2-Aug-02 9:21 
Marc Clifton wrote:
And if you change the DWORD to a WORD, do you diligently search and replace all references to the variable name with the corrected name? Maybe you do, but I bet a lot of other people don't.

Yes you should. And it is easy to do. Simply change the declaration and the compiler will not compile until you have made all the neccessary changes. This is about as close to forced self documenting code as it gets. Comments in context are far less easier to find and change.

Marc Clifton wrote:
Plus, why code the storage method as part of the name?

OK, so you see the following line of code, what does it mean?

bone = currentBone;

Is bone a string or a number or a class? So now you have to look at it's declaration. OK, so now you say, "Well, I wouldn't have named it bone or currentBone."(Hey, neither would I.)"I would have named it boneIndex or boneName." OK, so is boneIndex an iterator or a number or a key in map template? As for boneName, is it const char * or string? All this information is very important in debugging.

Marc Clifton wrote:
Isn't this why we have getter/setter methods, so we don't need to concern ourselves with internal implementation, and therefore don't care about the storage mechanism?

This helps for setting/getting members of a class, but what if you are just dealing with variables within code.

Also, remember cast conversion operators are inheirent in even basic types so...

const char * currentBone = "leg";
int bone = 0;

bone = currentBone;

This compiles, but it would far less likely to be written if it was:

const char * pszCurrentBone = "leg";
int nBone = 0;

nBone = pszCurrentBone;

Jason King
GeneralRe: VS 7 IDE speed Pin
Chris Maunder31-Jul-02 14:04
cofounderChris Maunder31-Jul-02 14:04 
GeneralRe: VS 7 IDE speed Pin
Ed Gadziemski3-Aug-02 4:05
professionalEd Gadziemski3-Aug-02 4:05 
GeneralEntropy Rules Pin
Stan Shannon29-Jul-02 9:22
Stan Shannon29-Jul-02 9:22 
GeneralRe: Entropy Rules Pin
Daniel Lohmann31-Jul-02 9:12
Daniel Lohmann31-Jul-02 9:12 
GeneralRe: Entropy Rules Pin
Chris Maunder31-Jul-02 14:08
cofounderChris Maunder31-Jul-02 14:08 
GeneralRe: Entropy Rules Pin
ColinDavies31-Jul-02 17:35
ColinDavies31-Jul-02 17:35 
GeneralRe: Entropy Rules Pin
Paul Watson4-Aug-02 1:41
sitebuilderPaul Watson4-Aug-02 1:41 
GeneralRe: Entropy Rules Pin
George4-Aug-02 3:02
George4-Aug-02 3:02 
GeneralFormatting is important because.... Pin
Roger Allen29-Jul-02 5:30
Roger Allen29-Jul-02 5:30 
GeneralRe: Formatting is important because.... Pin
James R. Twine29-Jul-02 7:42
James R. Twine29-Jul-02 7:42 
GeneralRe: Formatting is important because.... Pin
Armen Hakobyan29-Jul-02 11:31
professionalArmen Hakobyan29-Jul-02 11:31 
GeneralRe: Formatting is important because.... Pin
UltraJoe30-Jul-02 1:49
UltraJoe30-Jul-02 1:49 
GeneralRe: Formatting is important because.... Pin
Armen Hakobyan30-Jul-02 6:37
professionalArmen Hakobyan30-Jul-02 6:37 
GeneralRe: Formatting is important because.... Pin
UltraJoe30-Jul-02 7:55
UltraJoe30-Jul-02 7:55 
GeneralRe: Formatting is important because.... Pin
Armen Hakobyan30-Jul-02 11:53
professionalArmen Hakobyan30-Jul-02 11:53 
GeneralRe: Formatting is important because.... Pin
UltraJoe31-Jul-02 8:04
UltraJoe31-Jul-02 8:04 
GeneralRe: Formatting is important because.... Pin
Armen Hakobyan31-Jul-02 11:47
professionalArmen Hakobyan31-Jul-02 11:47 

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.