Re: Class member addressing
- From: "Michael C" <mculley@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 13:28:46 +1000
"Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:u4o7xuwpFHA.1148@xxxxxxxxxxxxxxxxxxxxxxx
>I sort of disagree with the take in "this". this is implicit for members so
>one need not type it *except* when using an IDE with intellisense where
>typeing "this.som" is way easier than typeing
>"SomeLongMethodNameThatsEasyToMisspell". Having this. in a statement is not
>hard to read and adds no overhead for the compiler.
Try
som ctrl space
I must say I'm suprised at the number of developers who don't know this
extremely useful shortcut :-) I must use it, without exaggeration, 200 times
a day when coding.
> Even though it's discouraged by the style-police I wholeheartedly agree
> with the prefix of an underbar in private members because a program
> written in C# that doesn't make use of the underbar for private members
> and relies only on capitalization for the distinction between the member
> and the accessor property is a complete pig to translate to VB.
Plus it eliminates conflicts (and hence possible bugs) between variable
name. When naming a private variable or function parameter there is zero
chance it will conflict with a class variable. I believe the MS standard
used to have the underscore and at least some of the private variables in
the framework have it.
Michael
.
- References:
- Class member addressing
- From: MM
- RE: Class member addressing
- From: Javaman59
- Re: Class member addressing
- From: Bob Powell [MVP]
- Class member addressing
- Prev by Date: RE: const or readonly
- Next by Date: Re: python and C#?
- Previous by thread: Re: Class member addressing
- Next by thread: Re: Class member addressing
- Index(es):
Relevant Pages
|