Adam Heath wrote:
Adrian Crum wrote:
I like using the this keyword because it makes the scope clear. I find
it makes it easier for me to understand someone else's code.

That's the compilers job, don't try to do an end run around it.

Excuse me??

int var2 = someMethod(someValue);

The scope of var2 is clear - it is a local variable. What is the scope of someMethod? It could be an instance method or a static method. What is the scope of someValue? It could be a local variable, an instance field, or a class field.

Using the this keyword would make that line of code a lot clearer to someone looking at it for the first time.

Reply via email to