tags:

views:

91

answers:

3

The scope of my question is solely ASP.NET, as the answer may be different for Java and any other C based language.

How much overhead is involved when using the keyword "this" within a class to dereference a property? It seems that I've seen certain sources try to discourage the use of "this" for dereferencing, but generaly I've just ignored them until now.

A: 

StyleCop recommended using this for all instance field reference.

And when compared to access the said field through a property, shouldn't it actually be faster (albeit unnoticable) by bypassing abstraction?

Adrian Godong
+1  A: 

I think it is just a style issue. As stated in the answer to this question, the compiler injects 'this' into implicit uses of this. I would use it for clarity.

Xetius
Thanks for the link. It supplied me with what I was looking for.
Jagd
A: 

No overhead.

Jeremy Stein