commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chaffee / Purple Technology <g...@stinky.com>
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"
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?

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


Mime
View raw message