Re: C# coding guidelines: use "this." or not when referring to member fields/properties within the object?



"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


.



Relevant Pages

  • [Superfreaks/ACRA] Superfreaks Season 2 #1
    ... John Phelps, Mark Johnston and Tom ... Jackson: police officers. ... Detective Michael King nodded. ... if I can draw a picture of the suspect based on the ...
    (rec.arts.comics.creative)
  • Re: "Urban Bike"????
    ... > reexamine and possibly modify their assumptions. ... I suspect the LBS ... > owners frequenting r.b.t face a degree of rigour here that they don't ...
    (rec.bicycles.tech)
  • Re: REAL Media (.ram) FILES not listed for BACKGROUND SOUNDS
    ... Thanks Michael - yes, I suspected they may have copied that info! ... I have a question - do you mean you were able to convert a RAM file into a ... WAV file in order to make it work in OE? ... > I suspect that they copied the information from the Microsoft article. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: knotes executable file lost
    ... > reason, that the executable file has gone bad. ... That's a generally rare occurrence and usually the last thing I'd ... suspect. ...
    (alt.os.linux.suse)
  • Re: Dont like someone? Have the police take their car.
    ... We suspect you, therefore, you're guilty. ... Just because you think it's rare does not make it a non-issue. ... I'll agree that mistakes happen. ...
    (rec.autos.driving)