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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY 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: Ted Dennison Subject: Re: C vs. Ada - strings Date: 2000/05/03 Message-ID: <8eprvb$jcf$1@nnrp1.deja.com>#1/1 X-Deja-AN: 618794217 References: <390F0D93.F835FAD9@ftw.rsc.raytheon.com> <8en5o9$ihe$1@nnrp1.deja.com> <391061AF.A15CE59C@ftw.rsc.raytheon.com> X-Http-Proxy: 1.0 x39.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed May 03 18:42:56 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-05-03T00:00:00+00:00 List-Id: In article <391061AF.A15CE59C@ftw.rsc.raytheon.com>, Wes Groleau wrote: > > Correct. But the original statement was something like "even Ada 83 > strings are better than C strings." When criticizing C, it's not fair > to criticize it for what it is when you take away its standard > libraries. > Throughout my Ada-83 career, I have had to make extensive use of > home-brewed code very similar to the Ada 95 sting packages. If for That's true. I'd still argue that *orignial* statement was right too. But I'm probably treading the grounds of opinion there. Its a much more debatable point. In Ada 83's defense, I hardly ever felt like I missed better string handling at the time. I usually had access to Ada.String.Unbounded - like packages, and never used them. The only thing I think it really *had* to have added was the case-conversion routines. Just about everything else I can do fairly easily with slices, "&", and declare blocks. On the other hand, C's lack of these features pretty much *required* it to come with standard string handling. Otherwise C users would have been forced to write loops to perform even the most minor of operations (like they are for every other type of array). Folks who complain bitterly about Ada's strings usually never figured out how to properly work with them (or perhaps never *bothered* to figure it out). The mindset is very much different from C's. So how do I summarize this? If we are talking about comparing the languages themselves, C's strings clearly suck. If we include the standard libraries in our comparison, they only suck when compared to Ada 95. :-) And no matter how you look at it, C's arrays suck. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.