commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sandy McArthur" <sandy...@gmail.com>
Subject Re: [lang] this.foo() vs. foo()
Date Wed, 08 Mar 2006 04:06:43 GMT
On 3/7/06, Phil Steitz <phil.steitz@gmail.com> wrote:
> On 3/7/06, Phil Steitz <phil.steitz@gmail.com> wrote:
> > On 3/7/06, Sandy McArthur <sandymac@apache.org> wrote:
> > > On 3/7/06, Gary Gregory <ggregory@seagullsoftware.com> wrote:
> > > > 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?
> > > >
> > > > I am willing to do this clean up, actually, I'll let Eclipse do it ;)
> > > >
> > > > Or, we can leave it all as is, with some classes doing it one way and
> > > > others the other way.
> > >
> > > My position is that as you're working on a chunk of code, clean it up
> > > to whatever you like but DO NOT go changing code just for cosmetic
> > > sake.
> > >
> >
> > Phil says +1 to the remark above.  Of course you could tell it is Phil
> > speaking by the from header and the sig below ;-)
> >
> > Phil
>
> Seriously, Craig makes an important point as does Gary (about the code
> being public).  I should not have responded categorically.  I
> personally do not agree in this case, but agree that style changes are
> OK if community (meaning those actually maintaining the code base)
> agree.
>
> Phil

I don't think there should ever be a sweeping code reformat if for no
other reason than it obscures how recently a block of code has been
reviewed by `svn blame`. I try to make commits that only change lines
that I've thought about and will own up to regardles if they end up
being good or bad.

Back to the original post, my preference is against "this.foo()"
because I'd bet the compiler generates more bytecode for the "this."
and because it doesn't really add anything unless you are using a text
editor without syntax highlight and other built in Java intelligence.

--
Sandy McArthur

"He who dares not offend cannot be honest."
- Thomas Paine

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message