Re: underscore prefix

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Rakesh Rajan (RakeshRajan_at_discussions.microsoft.com)
Date: 07/05/04


Date: Mon, 5 Jul 2004 08:49:01 -0700

Hmm...I have always been in the opinion that whenever we have an exposed member like a public variable or property etc, we should avoid Hungarian Notation and prefixes of any type. But for private entities, I would use m_ or a prefix...

-- 
Rakesh Rajan
"Scott Allen" wrote:
> I think the guidlines actually discourage use of m_ when it says "Do
> not apply a prefix to field names or static field names."
> 
> --
> Scott
> http://www.OdeToCode.com
> 
> On Mon, 5 Jul 2004 11:40:41 +0300, "Tamir Khason"
> <tamir-NOSPAM@tcon-NOSPAM.co.il> wrote:
> 
> >This is olb naming convention for private variables. In new MS naming
> >convention you should use m_ as prefix for private members
> >More information can be found here
> >http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnamingguidelines.asp
> >or use FxCop to validate
> >http://www.gotdotnet.com/team/fxcop/
> 
> 


Relevant Pages

  • Re: underscore prefix
    ... This is olb naming convention for private variables. ... convention you should use m_ as prefix for private members ... > explanation for the reason for this. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: underscore prefix
    ... not apply a prefix to field names or static field names." ... >This is olb naming convention for private variables. ... >convention you should use m_ as prefix for private members ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Private variables question
    ... there seems to be a lot of code around where the private variables ... What I guess i'm asking is why prefix it with 'F'? ... I've also gotten into the habit of prefixing local variables with L. ... This isn't so much to make them easier to spot, ...
    (borland.public.delphi.non-technical)
  • Re: Private variables question
    ... This is more from a mater of interest than any technical reason, but there seems to be a lot of code around where the private variables are called FSomething e.g. ... Me on the other hand I couldn't care less what the prefix is I just use the auto complete feature of the IDE which auto prefix the private members with F and it doesn't give me an option which I can change it. ...
    (borland.public.delphi.non-technical)