Re: What is the standard for naming objects?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



GhostInAK <ghostinak@xxxxxxxxx> wrote:
Hello rsine@xxxxxxxxxxxxxxxxxxx,

For those of you wondering where the "m" prefix came from that so many of
you use, it used to originally mean member variable and was typically used
to decorate what we now call private fields (class-level private variables)
in .NET.

The privacy doesn't affect whether or not they're member variables -
they're still called member variables, or instance variables, whether
they're public (let's hope not), protected, whatever.

(I'm not recommending anything other than private fields - don't get me
wrong.)

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: What is the standard for naming objects?
    ... GhostInAK wrote: ... but on the whole I havent noticed many people exposing these ... they're still called member variables, or instance variables, whether ... (I'm not recommending anything other than private fields - don't get ...
    (microsoft.public.dotnet.general)
  • Re: What is the standard for naming objects?
    ... but on the whole I havent noticed many people exposing these "m"-decorated fields publicly... ... noone will ever find their bodies. ... they're still called member variables, or instance variables, whether ... (I'm not recommending anything other than private fields - don't get ...
    (microsoft.public.dotnet.general)
  • Re: What is the standard for naming objects?
    ... For those of you wondering where the "m" prefix came from that so many of ... The privacy doesn't affect whether or not they're member variables - ... (I'm not recommending anything other than private fields - don't get me ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.general)
  • Re: Member Variables Naming Convention
    ... But other than the example above, does an "_" prefix provide any value? ... and remembering that Intellisense is case-INsensitive, ... all member variables appear at the top of the list in the ... I spend most of my coding and debugging time, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the o
    ... book in which he recommends the m_ prefix as well. ... If you follow Microsoft coding guidelines, member variables, local ... variables and function parameters will have the same naming convention ... I then got tired of it and reverted to prefixing all my member variables ...
    (microsoft.public.dotnet.languages.csharp)