Click here to Skip to main content
15,912,329 members

Survey Results

Naming conventions in your code   [Edit]

Survey period: 24 Nov 2003 to 30 Nov 2003

What notations do you use when coding?

OptionVotes% 
Hungarian notation with prefixes (strFirstName, m_nNumber etc)76150.13
Hungarian notation without prefixes ( _nNumber etc)432.83
Camel Caps (numberOfDays, isValid etc)46230.43
Pascal case (BackColor, DataSet)17911.79

View optional text answers (92 answers)


 
GeneralRe: Gool ol' Hungarian Pin
Blake Miller24-Nov-03 10:54
Blake Miller24-Nov-03 10:54 
GeneralRe: Gool ol' Hungarian Pin
Alvaro Mendez24-Nov-03 9:17
Alvaro Mendez24-Nov-03 9:17 
GeneralRe: Gool ol' Hungarian Pin
Ravi Bhavnani24-Nov-03 9:40
professionalRavi Bhavnani24-Nov-03 9:40 
GeneralRe: Gool ol' Hungarian Pin
Mike Osbahr27-Nov-03 4:55
Mike Osbahr27-Nov-03 4:55 
GeneralRe: Gool ol' Hungarian Pin
Anonymous27-Nov-03 9:09
Anonymous27-Nov-03 9:09 
GeneralRe: Gool ol' Hungarian Pin
Alvaro Mendez28-Nov-03 5:20
Alvaro Mendez28-Nov-03 5:20 
GeneralRe: Gool ol' Hungarian Pin
Shog924-Nov-03 14:27
sitebuilderShog924-Nov-03 14:27 
GeneralHungarian is evil Pin
Navin25-Nov-03 4:54
Navin25-Nov-03 4:54 
Michael Dunn wrote:
they make code easier to read and easier to understand

This is where I disagree. I would be interested in seeing a concrete example of this, because in my entire programming career, I have NEVER seen a piece of code where Hungarian notation made it easier to read or less prone to bugs, and NEVER seen a piece of code that is not written with Hungarian, but that Hungarian made it more readable.

99% of the time you shold be able to tell what a variable is and does based on its name and context. The other 1% of the time, use IntelliSense to figure it out, or have the header open in another window so you can see it directly.

Hungarian causes big problems when a variable type changes... then you either have to go through and search/replace all the types, or, more commonly, leave the old Hungarian but use a new type, thus making the previxes irrelevant.

Also, some prefixes just don't make sense. It took me forever to figure out what "lpsz" meant.

So, in my experience, Hungarian just adds an extra layer of complexity to the code that is unnecessary.

[EDIT] Actually, I did come up with an example of where a type prefix makes sense, see my post above for details.[/EDIT]

No single raindrop believes that it is responsible for the flood.
GeneralRe: Hungarian is evil Pin
Tim Smith25-Nov-03 16:54
Tim Smith25-Nov-03 16:54 
GeneralRe: Hungarian is evil Pin
Navin26-Nov-03 3:16
Navin26-Nov-03 3:16 
GeneralRe: Gool ol' Hungarian Pin
deo25-Nov-03 12:15
deo25-Nov-03 12:15 
GeneralRe: Gool ol' Hungarian Pin
Patje25-Nov-03 22:58
Patje25-Nov-03 22:58 
GeneralRe: Gool ol' Hungarian Pin
Mehdi Mousavi26-Nov-03 1:40
Mehdi Mousavi26-Nov-03 1:40 
GeneralRe: Gool ol' Hungarian Pin
peterchen29-Nov-03 2:53
peterchen29-Nov-03 2:53 
GeneralOnly habits... Pin
andyj11524-Nov-03 2:14
andyj11524-Nov-03 2:14 
GeneralRe: Only habits... Pin
Anonymous24-Nov-03 8:32
Anonymous24-Nov-03 8:32 
GeneralRe: Only habits... Pin
Dimitris Vasiliadis25-Nov-03 9:22
Dimitris Vasiliadis25-Nov-03 9:22 
GeneralRe: Only habits... Pin
andyj11525-Nov-03 9:37
andyj11525-Nov-03 9:37 
GeneralRe: Only habits... Pin
Dimitris Vasiliadis25-Nov-03 20:06
Dimitris Vasiliadis25-Nov-03 20:06 
GeneralRe: Only habits... Pin
Navin25-Nov-03 9:47
Navin25-Nov-03 9:47 
GeneralRe: Only habits... Pin
John R. Shaw25-Nov-03 9:53
John R. Shaw25-Nov-03 9:53 
GeneralRe: Only habits... Pin
andyj11525-Nov-03 10:20
andyj11525-Nov-03 10:20 
GeneralRe: Only habits... Pin
John R. Shaw25-Nov-03 10:46
John R. Shaw25-Nov-03 10:46 
GeneralRe: Only habits... Pin
andyj11526-Nov-03 2:05
andyj11526-Nov-03 2:05 
GeneralRe: Only habits... Pin
John R. Shaw27-Nov-03 8:14
John R. Shaw27-Nov-03 8:14 

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.