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 17:10:46 +1000
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1eb3db3bf24bd01398d12a@xxxxxxxxxxxxxxxxxxxxxxx
For me, a good reason is: "there may not be any validation now, but I
suspect there might be in the future".
It all depends on the situation but I think it is rare that the class itself
needs to access the variable though the property. There is no point turning
a high speed variable access into a slower function call every time just in
case something might change in the future. If it does change and it becomes
appropriate to use the property then modify the code.
Michael
.
- Follow-Ups:
- Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- From: Willy Denoyette [MVP]
- Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- From: Christoph Nahr
- Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- From: Bruce Wood
- Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- From: Jon Skeet [C# MVP]
- Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- References:
- C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- From: Dave
- Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- From: Michael C
- Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- From: Jon Skeet [C# MVP]
- C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- Prev by Date: Re: C# as a programming language
- Next by Date: Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?
- 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
|