commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <...@finemaltcoding.com>
Subject Re: More comment on (re-vote) XxxUtils constructors
Date Wed, 21 Aug 2002 08:00:55 GMT
"Stephen Colebourne" <scolebourne@btopenworld.com> writes:

> From: "Nicola Ken Barozzi" <nicolaken@apache.org>
> > Geir Magnusson Jr. wrote:
> > > On 8/18/02 3:07 PM, "Jesper de Jong" <jespdj@yahoo.com> wrote:
> > > Except, what's the harm for instantiation?  If I see the javadoc, see
> all
> > > methods are static and still choose, for some reason to create an
> instance?
> > >
> > > I am trying to think of why you wouldn't want to allow this....
> >
> > I know why: purism... or puritanism?
> >
> > The fact is that someone wants to prohibit the users from doing
> > something that Java doesn't necessary disallow.
> >
> > Why?
> >
> > I *still* have to see the code that tells me that it's bad.
> > Please, show me the *code*.
> >
> > Arguing over code purity is sensless without examples.
> 
> 1) boolean result = StringUtils.contains("peachy", "each");
> 2) StringUtils utils = new StringUtils();
>     boolean result = utils.contains("peachy", "each");
> 
> For general coding the first of these is correct, the second is basically
> just wrong. It wastes memory and it misleads.

It's not wrong at all.  How am I supposed to class load StringUtils
without that constructor?  And don't say I'm not supposed to
instantiate it; a clear need for just that has been demonstrated by
the project that donated the code in the first place.  Case closed,
end of story.  Read and interpret the Commons charter.
-- 

Daniel Rall <dlr@finemaltcoding.com>

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


Mime
View raw message