On 3/7/06, Gary Gregory <[EMAIL PROTECTED]> wrote:
> Hello:
>
> This could be a religious issue... look out!
>
> In our product code bases, we use the "this.foo()" convention. The
> argument being, that in object oriented programming, a message is sent
> to an object, always.
>
> How does the list feel about cleaning up foo()'s to this.foo()'s?

For the same reason I'm against mindless javadoc:

/**
 * Gets the name
 *
 * @return the name
 */
public String getName() {
    return this.name;
}

I'm also against this.foo() everywhere - it's non-useful noise for the
sake of being right.

----------

However, with Java 1.5 the addition of static imports has given us a
reason to want to use it.

this.name() clearly states that it is on this class; while name()
might be pulled from another class.

If I was forced to use static imports (which generally I'm avoiding
like the plague), the above might be a tempting convention as it would
have a use.

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to