Actually there is one small comment in the last bullet at http://msdn.microsoft.com/library/default.asp?url=""

"Do not apply a prefix to field names or static field names. Specifically, do not apply a prefix to a field name to distinguish between static and nonstatic fields. For example, applying a g_ or s_ prefix is incorrect."

That results in the vb.net problem. I'm not sure if that comment should be read as a whole meaning that is is only referring to g_ and s_ or if the first setence is meant to stand by itself.

On 7/13/06, Bob Hanson <[EMAIL PROTECTED]> wrote:
Actually there is no specific naming guideline for .NET fields:
http://msdn.microsoft.com/library/default.asp?url=""

I read mutiple places that MS teams are free to use their own convention which apparently results in "_", "m_" or no prefix.

I had been using "_" but switched to using nothing and instead I started putting "this." in front of all fields. I figured why add a convention when the class has a built in mechanism for this. The only plus was saving 4 characters of typing.

However, I then had to do some VB.NET development and the language isn't case sensitive. I've seen some examples that add a "Field" suffix in VB.NET . I think that is worse than a leading "_". So I came full circle and started using "_" again. :)


On 7/13/06, Gilles Bayon < [EMAIL PROTECTED]> wrote:


The MS .NET guidelance is to prefix private field with an underscore, this will resolve the conflict name for now.



Reply via email to