'this' instance field reference
"A. Kevin Baynes" <[email protected]>
| Newsgroups | gmane.org.user-groups.trijug.juglist |
|---|---|
| Message-ID | <[email protected]> |
In an unformal code review, I have a colleague who wrote : -- 'Access to instance fields should be prefixed with "this."' and 'Note I'm talking about variables here, not methods. I agree that "this." is unconventional on method calls, but I think there is fairly universal agreement these days about use of "this." on *variables*.' -- I know that 'this' is needed to resolve class level varaibles obscured within a method by a local variable of the same name, and is needed to call sibling constructors. I don't see any problem in referencing class variables as 'this.foo' if you wish, it reads the same to me. My question is 'this' : Do any of you support this purported 'univeral agreement' theory? -- A. Kevin Baynes Life's a garden. Dig it!