commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [lang] StringUtils overlay/concatenate/getNested
Date Sat, 02 Aug 2003 00:10:38 GMT
OK, commits are

- overlayString --> overlay
with better defined semantics/tests for odd cases

- getNestedString --> substringBetween
a much better name

- concatenate --> join
join being too well established to change, but concatenate being just
strange on its own

Stephen

----- Original Message -----
From: "Phil Steitz" <steitzp@yahoo.com>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Friday, August 01, 2003 7:56 PM
Subject: RE: [lang] StringUtils overlay/concatenate/getNested


> FWIW, I agree with all of Henri's views, except that I am more +1 on the
> concatenate -> join change.  To me, concatenate connotes a binary
operation
> (like +), but StringUtils.concatenate is an array operation. I like join
> better.
>
> Phil
>
> --- Henri Yandell <bayard@generationjava.com> wrote:
> >
> >
> > On Thu, 31 Jul 2003, Gary Gregory wrote:
> >
> > > I am always for choosing better names.
> >
> > Many of these names are my fault, as with much of StringUtils, and I'm
> > loving that the community part of open-source is paying off for me.
> > Smarter people are looking at my ideas with a different perspective and
> > massively improving them. Quite humbling in fact.
> >
> > > >- overlayString - shouldn't have 'String' in name. Better named as
> > > 'replace'
> >
> > But we already have a replace method? Unless I'm on crack, the
> > functionalities are quite different. Overlay takes a text and
effectively
> > replaces based on a set of indexes, rather than replacing characters.
> >
> > +1 to removing String
> > -0 to replace
> > +0 to another name than 'overlay'
> >
> > > >- concatenate - does the name as join(array, null) so should be
called
> > > join(array)
> > >
> > > I cannot say I am fond of the whole 'join' terminology. It seems to
> > > math-like for String objects (as opposed to Sets). Since strings are
> > 'added'
> > > together with '+', has 'add' been proposed? Not a great choice I know.
> > >
> > > +0
> >
> > My only problem with join is something someone pointed out to me not
long
> > after I accepted that 'join' was more Java than the explode/implode I'd
> > used elsewhere. They pointed out that Java already has a join method on
> > every Object. So in effect we're overloading a threading method. Kinda.
> >
> > Having join(array) makes more logical sense, but I also think that
people
> > might be looking for a 'concat' style of function.
> >
> > +0 too. I feel people will complain, but it does seem the right choice.
> >
> > > >- getNestedString - poor name, again with String in it.
> > >
> > > 'Nested' seems wrong to me. This is just a 'substring'-type of
> > operation,
> > > how about 'substringBetween'? We already have 'substringAfter' and
> > > 'substringBefore', so this seems to fit just, well, just between. ;-)
> >
> > +1 to substringBetween.
> >
> > It's not sexy, but it does help to group the method nicely with the
> > substring collection.
> >
> > Hen
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> ---------------------------------------------------------------------
> 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