Click here to Skip to main content
15,909,518 members

Survey Results

Naming conventions in your code   [Edit]

Survey period: 31 Jan 2005 to 6 Feb 2005

What notations do you use when naming variables? (And have things changed since we first asked back in 2003?)

OptionVotes% 
Hungarian notation with prefixes (strFirstName, m_nNumber etc)77140.86
Hungarian notation without prefixes ( _nNumber etc)492.60
Camel Caps (numberOfDays, isValid etc)72538.42
Pascal case (BackColor, DataSet)22511.92
C-style (this_is_a_variable)492.60
FORTRAN case (all caps)30.16

View optional text answers (82 answers)


 
GeneralRe: camelCase vs Hungarian Pin
mlkeS1-Feb-05 15:37
mlkeS1-Feb-05 15:37 
GeneralRe: camelCase vs Hungarian Pin
slimtim1-Feb-05 20:00
slimtim1-Feb-05 20:00 
GeneralRe: camelCase vs Hungarian Pin
James R. Twine2-Feb-05 6:03
James R. Twine2-Feb-05 6:03 
GeneralRe: camelCase vs Hungarian Pin
slimtim2-Feb-05 9:10
slimtim2-Feb-05 9:10 
GeneralRe: camelCase vs Hungarian Pin
Dale Thompson2-Feb-05 12:34
Dale Thompson2-Feb-05 12:34 
GeneralRe: camelCase vs Hungarian Pin
paulccc2-Feb-05 23:16
paulccc2-Feb-05 23:16 
GeneralRe: camelCase vs Hungarian Pin
BluePineNeedles3-Feb-05 1:54
BluePineNeedles3-Feb-05 1:54 
GeneralRe: camelCase vs Hungarian Pin
James R. Twine3-Feb-05 3:58
James R. Twine3-Feb-05 3:58 
BluePineNeedles wrote:
And yes, I think that: NumberOfUsersOnline is easier to read than gliNumberOfUsersOnline or some of the even uglier examples.

   Well, the purpose of notations like (reverse) "Hungarian Notation" is not to make "something" easy to read - children's books are "easy to read".  It is supposed to provide more information on what that "something" is and possibly how it used.

   Yes, NumberOfUsersOnline is less characters and, to the untrained eye (i.e. your average everyday user), likely looks nicer than gliNumberOfUsersOnline.  But looking at NumberOfUsersOnline provides me with no information on what it is (String, Integer, Floating Point?), and without that information readily available, you may have to waste additional resources just to figure out how and if you can use it.

   IMHO, LTTLS1 is no longer a viable option given the amount and complexity of code being written these days.

   Peace!

1: Look To The Left Stupid - A method of finding out a variable's type by looking to the left of its declaration, going through as many files as required to actually find it.

-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites

GeneralRe: camelCase vs Hungarian Pin
paulccc3-Feb-05 7:41
paulccc3-Feb-05 7:41 
GeneralRe: camelCase vs Hungarian Pin
BluePineNeedles3-Feb-05 8:15
BluePineNeedles3-Feb-05 8:15 
GeneralRe: camelCase vs Hungarian Pin
Alvaro Mendez4-Feb-05 7:09
Alvaro Mendez4-Feb-05 7:09 
GeneralRe: camelCase vs Hungarian Pin
Andy Davies5-Feb-05 12:13
Andy Davies5-Feb-05 12:13 
GeneralRe: camelCase vs Hungarian Pin
WillemM2-Feb-05 8:16
WillemM2-Feb-05 8:16 
GeneralRe: camelCase vs Hungarian Pin
Alvaro Mendez3-Feb-05 4:57
Alvaro Mendez3-Feb-05 4:57 
GeneralRe: camelCase vs Hungarian Pin
trevstar4-Feb-05 11:50
trevstar4-Feb-05 11:50 
Generalmisspellings Pin
Marc Clifton1-Feb-05 4:42
mvaMarc Clifton1-Feb-05 4:42 
GeneralRe: misspellings Pin
Anonymous1-Feb-05 6:35
Anonymous1-Feb-05 6:35 
GeneralRe: misspellings Pin
Aleksei Guzev2-Feb-05 23:46
Aleksei Guzev2-Feb-05 23:46 
GeneralRe: misspellings Pin
Charlie Williams1-Feb-05 8:05
Charlie Williams1-Feb-05 8:05 
GeneralRe: misspellings Pin
Jörgen Sigvardsson1-Feb-05 11:17
Jörgen Sigvardsson1-Feb-05 11:17 
GeneralRe: misspellings Pin
David Wulff2-Feb-05 5:34
David Wulff2-Feb-05 5:34 
GeneralRe: misspellings Pin
Ravi Bhavnani5-Feb-05 9:32
professionalRavi Bhavnani5-Feb-05 9:32 
GeneralApparently... Pin
Gary Kirkham1-Feb-05 4:18
Gary Kirkham1-Feb-05 4:18 
GeneralRe: Apparently... Pin
toxcct1-Feb-05 6:16
toxcct1-Feb-05 6:16 
GeneralRe: Apparently... Pin
Gary Kirkham2-Feb-05 3:37
Gary Kirkham2-Feb-05 3:37 

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.