Click here to Skip to main content
15,911,715 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: 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 
GeneralWhy camelCased? Pin
QuiJohn3-Apr-06 2:32
QuiJohn3-Apr-06 2:32 
GeneralRe: Why camelCased? Pin
Ryan Roberts3-Apr-06 3:01
Ryan Roberts3-Apr-06 3:01 
David Kentley wrote:
What's the point?


It's different from Pascal cased, so you dont have to think of variable names in circumstances that don't require it.

<br />
<br />
public void Stuff()<br />
{<br />
    ThingAmiBob thingAmiBob = new ThingAmiBob();<br />
}<br />
<br />


Is better in my opinion than

<br />
<br />
public void Stuff()<br />
{<br />
    ThingAmiBob MyThingAmiBob = new ThingAmiBob();<br />
}<br />
<br />


You can easily tell instance from type by the casing, without having to add prefixes or think up potentialy confusing names.

Ryan

"Michael Moore and Mel Gibson are the same person, except for a few sit-ups. Moore thought his cheesy political blooper reel was going to tell people how to vote. Mel thought that his little gay SM movie about his imaginary friend was going to help him get to heaven."
- Penn Jillette

GeneralRe: Why camelCased? Pin
QuiJohn3-Apr-06 5:59
QuiJohn3-Apr-06 5:59 
GeneralRe: Why camelCased? Pin
Ryan Roberts3-Apr-06 6:41
Ryan Roberts3-Apr-06 6:41 
GeneralRe: Why camelCased? Pin
QuiJohn3-Apr-06 6:48
QuiJohn3-Apr-06 6:48 
GeneralRe: Why camelCased? Pin
worldspawn3-Apr-06 20:59
worldspawn3-Apr-06 20:59 
GeneralRe: Why camelCased? Pin
Karl Josefsson3-Apr-06 23:09
Karl Josefsson3-Apr-06 23:09 
GeneralRe: Why camelCased? Pin
worldspawn4-Apr-06 13:41
worldspawn4-Apr-06 13:41 
GeneralRe: Why camelCased? Pin
Karl Josefsson5-Apr-06 5:33
Karl Josefsson5-Apr-06 5:33 
GeneralRe: Why camelCased? Pin
tec-goblin3-Apr-06 23:54
tec-goblin3-Apr-06 23:54 
GeneralRe: Why camelCased? Pin
Kevin McFarlane3-Apr-06 10:12
Kevin McFarlane3-Apr-06 10:12 
GeneralRe: Why camelCased? Pin
Zoltan Balazs4-Apr-06 4:41
Zoltan Balazs4-Apr-06 4:41 
GeneralRe: Why camelCased? Pin
Hugo Vale4-Apr-06 5:05
Hugo Vale4-Apr-06 5:05 
GeneralRe: Why camelCased? Pin
Blake Miller4-Apr-06 6:13
Blake Miller4-Apr-06 6:13 
GeneralRe: Why camelCased? Pin
Ryan Roberts5-Apr-06 0:34
Ryan Roberts5-Apr-06 0:34 
GeneralRe: Why camelCased? Pin
Karl Josefsson5-Apr-06 5:42
Karl Josefsson5-Apr-06 5:42 
GeneralRe: Why camelCased? Pin
Leslie Sanford4-Apr-06 9:35
Leslie Sanford4-Apr-06 9:35 
GeneralRe: Why camelCased? Pin
Ryan Roberts5-Apr-06 0:31
Ryan Roberts5-Apr-06 0:31 
GeneralRe: Why camelCased? Pin
Todd Smith6-Apr-06 9:15
Todd Smith6-Apr-06 9:15 

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.