Re: underscore prefix

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

From: Tamir Khason (tamir-NOSPAM_at_tcon-NOSPAM.co.il)
Date: 07/05/04


Date: Mon, 5 Jul 2004 11:40:41 +0300

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/

-- 
       Tamir Khason
You want dot.NET? Just ask:
 "Please, www.dotnet.us "
"mike parr" <mparr_1972@yahoo.co.uk> wrote in message
news:Oxr9EmmYEHA.3664@TK2MSFTNGP12.phx.gbl...
> A few times when looking at code on the net I have seen objects,
> variables etc prefixed by an underscore.  But I've never seen any
> explanation for the reason for this.  What is the reason for doing this?
>
> Thanks,
>
> Mike
>
>
>
>
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!


Relevant Pages

  • Re: underscore prefix
    ... > I think the guidlines actually discourage use of m_ when it says "Do ... >>This is olb naming convention for private variables. ... >>convention you should use m_ as prefix for private members ...
    (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)