commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chaffee / Purple Technology <>
Subject Re: [lang] Summarising Purple Was: [lang] Adding Purple to StringUtils
Date Sun, 09 Mar 2003 21:24:47 GMT
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"
  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?

(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).

Alex Chaffee                     
Purple Technology - Code and Consulting
jGuru - Java News and FAQs       
Gamelan - the Original Java site 
Stinky - Art and Angst           

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message