Alexander Kellett wrote:
>
> On Tue, Oct 12, 2004 at 10:23:12PM +0900, Gavin Sinclair wrote:
> > Perhaps there are some uses of strings for which immutability makes
> > performance sense, and some uses for which it doesn't.  I couldn't be
> > bothered thinking about it :)
>
> i can't imagine many cases where its less performant in fact.
> immutable strings with cow are obviously far faster for copying
> than mutable strings and as with most systems its the copy /
> construction of strings rather than the iteration that takes
> the time i'd say its logical that they should be immutable.

Many years ago I attended a Java User's Group meeting in San Francisco where
the speaker was Mr. Java -- James Gosling, himself. This was back when the
JUG only attracted about 20 people, so it was a very intimate encounter.

During this meeting, James directly addressed the issue of immutable
strings. The true story is that the original Java had mutable strings.
However, the java integration with the netscape browser had an obscure bug
in string handling. They were unable to solve the problem before the
shipping deadline, and ended up "solving" it by making strings immutable.
James finally stated that it was (at that time) the one decision that he
most regretted.

Curt