Is all this Invarient **** er... stuff, premature optimisation?

Lars Ivar Igesund larsivar at igesund.net
Mon Apr 28 14:23:26 PDT 2008


Walter Bright wrote:

> Lars Ivar Igesund wrote:
>> After working with Java for quite some time, I have naturally drifted
>> from using invariant strings to stringbuffers.
> 
> Java strings lack slicing, so they're crippled anyway. I believe that
> slicing is one of those paradigm-shifting features, so I am not making
> an irrelevant point.

I agree that Java strings are crippled, but considering that String is
easier to use there than StringBuffer, I certainly would need good reasons
to prefer the latter? And I have.

Your point about slicing may not be irrelevant, but the kickass-ness of the
feature only truly comes to its right when combined with non-allocating
string operations. 

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango



More information about the Digitalmars-d mailing list