From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f868292008c639ce X-Google-Attributes: gid103376,public From: mike@t Subject: Re: C vs. Ada - strings Date: 2000/05/19 Message-ID: <8g53vk$1f32@drn.newsguy.com>#1/1 X-Deja-AN: 625644421 References: <390F0D93.F835FAD9@ftw.rsc.raytheon.com> <8en5o9$ihe$1@nnrp1.deja.com> <8eonos$e70$1@wanadoo.fr> <1fIU4.4668$Rx3.250161@typhoon.nyroc.rr.com> <3924B730.AFB52C1C@acenet.com.au> Organization: test Newsgroups: comp.lang.ada Date: 2000-05-19T00:00:00+00:00 List-Id: In article <3924B730.AFB52C1C@acenet.com.au>, Geoff says... > >Pete wrote: >> java strings are much better. >Only some aspects are better, many are much worse! >E.g., they're horribly slow, especially if you need to change them - >since they're immutable you have to create a new one. >(Being immutable allows getting substrings to be fast, among other >things). being immutable also means you can not modify them ;) >A StringBuffer only partially solves this problem. how so? what is wrong with StringBuffer? (please, no performance stuff, Java is pretty fast these days, almost as fast as C++ and C for most applications). only problem I see with java stringbuffers, is that it is easier to convert them to arrays first whenever you need to do scanning and replacments on them. it is always easier to write a[i], than a.elementAt(i), etc.. then covert the array back to string at the end. other than that, they are ok. mike