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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7bcba1db9ed24fa7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-08 07:57:01 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.bc.home.com.POSTED!not-for-mail Sender: stephen@anakin Newsgroups: comp.lang.ada Subject: Re: is ada dead? References: <3B460DA9.C2965042@ix.netcom.com> <9ff447f2.0107061757.34ca0723@posting.google.com> <9i6lak$bqi$1@geraldo.cc.utexas.edu> <3B475916.E4548A5D@worldnet.att.net> From: stephen_bevan@yahoo.com (Stephen J. Bevan) Message-ID: Organization: just me at home X-Newsreader: Gnus v5.7/Emacs 20.7 Date: Sun, 08 Jul 2001 14:57:01 GMT NNTP-Posting-Host: 24.77.89.252 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.bc.home.com 994604221 24.77.89.252 (Sun, 08 Jul 2001 07:57:01 PDT) NNTP-Posting-Date: Sun, 08 Jul 2001 07:57:01 PDT Xref: archiver1.google.com comp.lang.ada:9640 Date: 2001-07-08T14:57:01+00:00 List-Id: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) writes: > > You could do it like that. However, it would be more efficient to > > turn your String into a StringBuffer, which supports in-place updates. > > Make all the changes you want to the StringBuffer and then turn it > > back into a String. This way you'd only chew up approximately 3K. > > Programmers should not have to know the efficiency characteristics > of mechanisms underlying an implementation to that level of detail. I'm not sure what level of detail you are referring to here. The documentation for String hints quite strongly that you to use StringBuffer if want to make changes to a String. Knowing how StringBuffer is actually implemented IMHO is also important since that is the difference between O(1) and O(n) for some operations. The same is true for Unbounded_String in Ada.