Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- From: "Michael C" <nospam@xxxxxxxxxx>
- Date: Sat, 22 Apr 2006 09:56:09 +1000
"Dave" <none@xxxxxxxxxxx> wrote in message
news:%23uTFZ$XZGHA.3448@xxxxxxxxxxxxxxxxxxxxxxx
Also, while I'm thinking about it: should a class internally reference
properties by the property name or by the private variable that stores the
value? I've done both. I suppose the main thing is if the property does
more than just set the value of the private variable then the class code
should use the property name instead of the private variable.
You should do whatever is appropriate for each situation but favour the
private variable for sure. There is no point repeatedly calling a property
to do the same thing unless there is a good reason.
Michael
.
- Follow-Ups:
- References:
- Prev by Date: Re: Killing stray GDI objects
- Next by Date: Re: a dot or cross ;)
- Previous by thread: Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- Next by thread: Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- Index(es):
Relevant Pages
|
Loading