Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Errrhhh ..... CSharp or VB
Message
From
27/09/2011 21:18:52
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01524423
Message ID:
01524993
Views:
61
>>>But for C# using the '_' prefix adds nothing......
>>
>>it easily shows the scope of the variable...
>
>True. But I still can't find a MS link that actually advocates it although I've seen a few (as in the above) that imply that they do not....

I didn't find anything that would indicate that they would advocate it. So I would think they don't.

I do use it for private backing fields, just adding the _ in front of the property name. (I leave the rest in pascal case)

public property FooBar
private field _FooBar
parameter fooBar
local var foobar

I prefer that because property names are sometimes a single word so with:

public property Foo
private field _Foo
parameter foo
local var foo

only the last 2 can get confused and that's not normally an issue.

Why _FooBar instead of _fooBar... I'm too lazy to bother with lower casing the f <g>

But if I was coding in a team I would do whatever the team does, my personal preferences can be a bit unusual.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform