Click here to Skip to main content
15,911,035 members

Survey Results

Coding style: How do you name your local variables?   [Edit]

Survey period: 3 Apr 2006 to 9 Apr 2006

What's your convention de jour for your locals?

OptionVotes% 
Pascal Cased17110.56
camel Cased70243.36
Fixed letter prefix (eg lLocal)815.00
Hungarian prefix (eg strLocal)48229.77
Scope prefix (eg l_Local)362.22
Scope and Hungarian prefix (eg l_strLocal)1257.72

View optional text answers (100 answers)


 
GeneralRe: X Pin
toxcct4-Apr-06 0:58
toxcct4-Apr-06 0:58 
GeneralRe: X Pin
KarstenK4-Apr-06 2:58
mveKarstenK4-Apr-06 2:58 
GeneralRe: X Pin
KevinHall4-Apr-06 4:59
KevinHall4-Apr-06 4:59 
GeneralRe: X Pin
WillemM5-Apr-06 21:09
WillemM5-Apr-06 21:09 
GeneralRe: X Pin
KevinHall6-Apr-06 7:57
KevinHall6-Apr-06 7:57 
GeneralRe: X Pin
Guy Rousseau7-Apr-06 4:05
Guy Rousseau7-Apr-06 4:05 
GeneralRe: X Pin
super_ttd9-Apr-06 6:29
super_ttd9-Apr-06 6:29 
GeneralA mixture Pin
Ray Cassick3-Apr-06 5:15
Ray Cassick3-Apr-06 5:15 
I use a mixture of them for all my code.

Properties and methods use Pascal Casing...

Text
GetDisplayText


All internal variables use camel case...

customerCount
numberOfCalls

All private variables that pertain directly to the values accessible via a property or method are camel cased versions of the property...

text
getDisplayText

Any local variable that has module level scope (ie: vars global to a class) use are camel case with a leading 'm'...

mText
mNumberOfCalls

All GUI elements are camel cased with the prefix providing the control type...

txtUserName
chkSlection
cmbOptionDropdown

Constants are all upper case with an underscore separating the words...

THIS_IS_A_CONSTANT




My Blog[^]
FFRF[^]



-- modified at 11:15 Monday 3rd April, 2006
GeneralRe: A mixture Pin
jcrussell3-Apr-06 15:02
jcrussell3-Apr-06 15:02 
GeneralRe: A mixture Pin
Thomas Freudenberg4-Apr-06 8:06
Thomas Freudenberg4-Apr-06 8:06 
GeneralRe: A mixture Pin
Ray Cassick4-Apr-06 11:51
Ray Cassick4-Apr-06 11:51 
GeneralDifferentiating between parameters and locals Pin
Chris Maunder3-Apr-06 3:38
cofounderChris Maunder3-Apr-06 3:38 
GeneralRe: Differentiating between parameters and locals Pin
Ryan Roberts3-Apr-06 4:28
Ryan Roberts3-Apr-06 4:28 
GeneralRe: Differentiating between parameters and locals Pin
majahanson3113-Apr-06 5:30
majahanson3113-Apr-06 5:30 
GeneralRe: Differentiating between parameters and locals Pin
Kevin McFarlane3-Apr-06 10:06
Kevin McFarlane3-Apr-06 10:06 
GeneralRe: Differentiating between parameters and locals Pin
Shog94-Apr-06 15:59
sitebuilderShog94-Apr-06 15:59 
GeneralRe: Differentiating between parameters and locals Pin
toxcct4-Apr-06 0:56
toxcct4-Apr-06 0:56 
GeneralRe: Differentiating between parameters and locals Pin
John R. Shaw6-Apr-06 16:44
John R. Shaw6-Apr-06 16:44 
GeneralEveryone seems to use a mix Pin
Gary R. Wheeler3-Apr-06 2:45
Gary R. Wheeler3-Apr-06 2:45 
GeneralRe: Everyone seems to use a mix Pin
Rob Caldecott3-Apr-06 3:04
Rob Caldecott3-Apr-06 3:04 
GeneralRe: Everyone seems to use a mix Pin
Gary R. Wheeler3-Apr-06 5:31
Gary R. Wheeler3-Apr-06 5:31 
GeneralRe: Everyone seems to use a mix Pin
Nitron3-Apr-06 3:30
Nitron3-Apr-06 3:30 
GeneralRe: Everyone seems to use a mix Pin
Gary R. Wheeler3-Apr-06 5:32
Gary R. Wheeler3-Apr-06 5:32 
GeneralRe: Everyone seems to use a mix Pin
stephenbayer3-Apr-06 9:36
stephenbayer3-Apr-06 9:36 
GeneralRe: Everyone seems to use a mix Pin
Gary R. Wheeler3-Apr-06 15:34
Gary R. Wheeler3-Apr-06 15:34 

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.