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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail From: "Jerry Coffin" Newsgroups: comp.lang.ada,comp.lang.c++ Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 23 Mar 2005 12:28:27 -0800 Organization: http://groups.google.com Message-ID: <1111609707.294612.108390@z14g2000cwz.googlegroups.com> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1111607633.301232.62490@z14g2000cwz.googlegroups.com> <1111609026.080271.186990@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: 165.236.235.120 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1111609711 7368 127.0.0.1 (23 Mar 2005 20:28:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 23 Mar 2005 20:28:31 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=165.236.235.120; posting-account=mZiOqwwAAAC5YZsJDHJLeReHGPXV5ENp Xref: g2news1.google.com comp.lang.ada:9826 comp.lang.c++:46896 Date: 2005-03-23T12:28:27-08:00 List-Id: Matthew Heaney wrote: > Jerry Coffin wrote: > > > > Speaking of strings, I'll digress for a moment: personally, I find > > it a bit humorous when Ada advocates talk about things like having > > five string types as an advantage. IMO, the need, or even belief, > > that five string types are necessary or even useful is a _strong_ > > indication that all five are wrong. > > It's the same as in C++: > > char[] > wchar_t[] > std::string > std::wstring > > The string types in Ada95 are very similar: > > String > Wide_String > Unbounded_String > Wide_Unbounded_String char[] and wchar_t[] are arrays, not strings. C++ really only has one string type: std::basic_string. std::string and std::wstring are not types of their own at all, but simply typedefs as: typedef std::basic_string string; typedef std::basic_string wstring; In addition, one of the major arguments the Ada fans have used here is that Ada's strings are built-in, NOT added as a class like in C++. If C++ had been designed from the beginning with a string class, the array-based "stuff" probably wouldn't exist at all. BTW, in case anybody really cares, yes I apply the same standard to C++: while its string handling facilities are fewer and IMO better than Ada's, they're still far short of perfect. -- Later, Jerry. The universe is a figment of its own imagination.