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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,971aa11c293c3db1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-20 06:43:54 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!grolier!nerim.net!norfair.nerim.net!not-for-mail From: "Bertrand Augereau" Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? Date: Fri, 20 Jul 2001 15:48:17 +0200 Organization: Nerim -- xDSL Internet Provider Message-ID: <9j9cip$238u$1@norfair.nerim.net> References: <3B59CD72@MailAndNews.com> <3B5573DA.5ABA8EA7@earthlink.net> <9j94gj$1uk6$1@norfair.nerim.net> <3B581E6B.6FB1DAEF@earthlink.net> NNTP-Posting-Host: aboukir-101-2-1-inutero.adsl.nerim.net X-Trace: norfair.nerim.net 995636633 68894 62.4.19.69 (20 Jul 2001 13:43:53 GMT) X-Complaints-To: abuse@nerim.net NNTP-Posting-Date: Fri, 20 Jul 2001 13:43:53 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:10334 Date: 2001-07-20T15:48:17+02:00 List-Id: That's right it's not as much automated as in Ada (anyway there's no value range in C++), it is merely a "technique", but you can do really nice stuff with this. For instance: Can you implement your own 'attributes in Ada to be evaluated at compile time? I guess not, but I haven't been doing Ada for some time. And that's what traits address in C++. And traits is just the upper part of the template metaprogramming in C++ iceberg (which is not melting). If you want something really interesting to read, go for "Modern C++ Design: Generic Programming and Design Patterns Applied" by Andrei Alexandrescu... And look for Loki(related to the book) and boost libraries on the web. It is about Metaprogramming and it is worth reading even if you don't do C++ intensively (though a bit hard if you're not used to templates), because I guess this will become more and more important, though most compilers are not good enough for allowing everything (partial specialization) (but it's getting better this days)... I know that you will say that Ada works NOW, but I have to ignore you and watch somewhere else ;-) If you only use some subset of C++ features, everybody support these. Maybe that's why your "C++ experts" buddies don't use that, or because it wasn't popular (it's still not in fact) at this time. By the way MSVC++ is not much compliant, though I have to use it everyday because with Intel c++ compiler plugin it's the best code generator for x86 architectures... > This is odd, having spent the last couple years immersed in C++ projects > with very experienced C++ programmers (including co-authoring a C++ > Programming Practices standard), I've never encountered anyone > suggesting their use, much less employing them. > > Doing a Google search on "C++ traits" brought up only a handful of > relevant entries, the contents of which described it more as a > "technique" than a language feature--and a technique available only to > templates at that. (Though I may be misinformed regarding this aspect, > I'm going by how traits were presented in the various references.) > > The only reference to something like traits in the MSVC++ Help Index was > a "traits_type" data member. Digging further, that did lead to the > discovery of MSVC++ supporting the traits technique, though as noted > above, only for specific template classes. > > And not a single one of my C++ books, including "The ANSI/ISO C++ > Professional Programmer's Handbook", published in 1999, has an index > entry for "traits". > > > While C++ type traits may be a technique to extract type information, > its applicability appears limited, and is certainly not available to > range constrained scalar type definitions. The use of the technique for > other than predefined classes (such as basic_string instantiated with > char) appears to require the _developer_ implement the functionality of > each trait. > > Hardly comparable to Ada automatically providing all this information > extraction functionality as part of its standard definition. > > Marc A. Criley > Senior Staff Engineer > Quadrus Corporation > www.quadruscorp.com