commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Caswell" <ste...@caswell.name>
Subject RE: [lang] Summarising Purple Was: [lang] Adding Purple to StringUtils
Date Sun, 09 Mar 2003 23:19:12 GMT




> -----Original Message-----
> From: Alex Chaffee / Purple Technology [mailto:guru@stinky.com] 
> Sent: Sunday, March 09, 2003 4:25 PM
> To: 'Jakarta Commons Developers List'
> Subject: Re: [lang] Summarising Purple Was: [lang] Adding 
> Purple to StringUtils
> 
> 
> On Sun, Mar 09, 2003 at 04:05:09PM -0500, Steven Caswell wrote:
> > > I think "bisect" is good since it explicitly means "two
> > > parts" rather than "split" which returns many parts.
> > 
> > Wouldn't "removeFromLast" describe the action more succiently than 
> > "bisect" or "divide"?
> 
> "from" is ambiguous... Which is clearer:
> 
>   removeAfterLast("my dog has dog fleas", "dog") -> "my dog has "
>   removeBeforeLast("my dog has dog fleas", "dog") -> " fleas" or
>   bisectBeforeLast("my dog has dog fleas", "dog") -> "my dog has "
>   bisectAfterLast("my dog has dog fleas", "dog") -> " fleas"
> 
> Or is "split" really the right root after all?

Or even
truncateAfterLast(String)
truncateBeforeLast(String)

since isn't that what is really happening?

For some reason I'm uneasy about bisect. But your point about being in
naming hell is appropriate.
So yeah, we should pick something close to the purpose and reserve the right
to change.

> 
> (This is the sort of tough naming decision that becomes clear 
> only after one has used the API in the wild for a while, and 
> (these days) renamed it a few times with a refactoring 
> tool...  So maybe we should just pick one and reserve the 
> right to change our mind before the first release.)
> 
> > > * toUnderscoreName, toCamelCaseName
> > > 
> > I still think these are more functionality than is intended in 
> > StringUtils. Would it make sense to put them into a 
> > StringConvertUtils?
> 
> But there are many "conversion" routines already in 
> StringUtils, so this would create an arbitrary and confusing 
> disjunction (confusing to those trying to figure out in which 
> class a certain method lies).

A good point, and since I don't have much more of an argument, I'll let it
go. I'm fuzzy on where the line is anyway. I just don't want to see the API
to get too out of control.

> 
> 
> -- 
> Alex Chaffee                               mailto:alex@jguru.com
> Purple Technology - Code and Consulting    http://www.purpletech.com/
> jGuru - Java News and FAQs                 http://www.jguru.com/alex/
> Gamelan - the Original Java site           http://www.gamelan.com/
> Stinky - Art and Angst                     http://www.stinky.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 

Steven Caswell
steven@caswell.name
a.k.a Mungo Knotwise of Michel Delving
"One ring to rule them all, one ring to find them..."



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