commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <ggreg...@seagullsoftware.com>
Subject RE: svn commit: r234385 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java
Date Mon, 22 Aug 2005 20:04:51 GMT
Hello:

Actually, my use of "this" is deliberate, it is the convention we use at
work and my personal preference as well. 

I am happy to use the convention of a given file/package/component of
course, but since this is new code, I though I'd give it a go. 

The main reason I use object.message() even when object = this, is that
I always think of sending a message in to an object. Granted Java takes
some shortcuts with primitives but I like to see things consistently:
object.message(). There is also a tricky issue that has to do with how
static methods are resolved that I do not recall right now (it has to do
with what happens you methods move around in edit/compile cycles.)

Gary

> -----Original Message-----
> From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
> Sent: Monday, August 22, 2005 11:44 AM
> To: Jakarta Commons Developers List
> Subject: Re: svn commit: r234385 -
>
/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text
/S
> trTokenizer.java
> 
> ggregory@apache.org wrote:
> > -            if (ignoreEmptyTokens) {
> > +            if (this.isIgnoreEmptyTokens()) {
> >                  return;
> >              }
> > -            if (emptyAsNull) {
> > +            if (this.isEmptyTokenAsNull()) {
> >                  tok = null;
> >              }
> 
> While I understand most of the change here, with the use of methods
> rather than direct field access, I dislike the above.
> 
> The 'this.' just seriously gets in the way of reading the code and
adds
> nothing of value. Perhaps it is just an artifact of a tool you used?
> 
> Stephen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
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