Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Errrhhh ..... CSharp or VB
Message
From
27/09/2011 05:09:16
 
 
To
26/09/2011 18:34:55
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01524423
Message ID:
01524801
Views:
52
>>>>I thought MS did not recommend using the underscore prefix for fields.
>>>>Do you have a reference to this recommendation?
>>>>They certainly don't use if here :http://msdn.microsoft.com/en-us/library/ms173118.aspx
>>>>
>>>>>If you follow standard .NET naming conventions, it isn't an issue at all.
>>>>>
>>>>>If a variable: customerName
>>>>>If a class: CustomerName
>>>>>If a field: _customerName
>>>>>
>>>>>
>>>>>>
>>>>>>I was talking about remembering whether a variable is customername, Customername or CustomerName. Craig indicates the IDE helps you.
>>>>>>
>>>>>>Alex
>>>
>>>
>>>BTW, Here's a link from a friend of mine, who's now a MS employee talking about this very thing...
>>>
>>>http://10rem.net/articles/net-naming-conventions-and-programming-standards---best-practices
>>
>>OK. From the link:
>>'Class level & private protected variables' (i.e. Fields):
>>"Microsoft recommends against the m_ (and the straight _)"
>>But he has a point in that for case-insensitive languages relying on Pascal/Camel case to differentiate isn't going to work :-}
>>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....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform