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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9cccf6ef6149fdaa X-Google-Attributes: gid103376,public From: tsikes@netcom.com (Terry Sikes) Subject: Re: Ada Date: 2000/01/04 Message-ID: <84thof$9r3$1@nntp4.atl.mindspring.net>#1/1 X-Deja-AN: 568272968 References: <38620350.48F8FC08@gecm.com> <83u8l0$5i5$1@nnrp1.deja.com> <84rd2f$snm$1@nntp3.atl.mindspring.net> Organization: NETCOM / MindSpring Enterprises, Inc. Newsgroups: comp.lang.ada Date: 2000-01-04T00:00:00+00:00 List-Id: In article , Hyman Rosen wrote: >tsikes@netcom.com (Terry Sikes) writes: >> There's a lot of discussion on the Java advocacy newsgroup about the >> desirability (or lack thereof;) of generics, operator overloading and >> so on. From what I can tell, Ada provides good implementations of >> these things as opposed to C++. > >C++ provides excellent implementation of generics, >and good implementation of overloading, except that >one cannot overload on return type as in Ada. I've perused the other responses to this so I won't touch on some points raised by others. In working fairly extensively with C++ generics (mainly STL, VC 6.0) I've come to the conclusion that at this time they are still totally pushing the envelope for the compiler writers. In my current project, for instance, fairly simple things like map generate identifiers in excess of 255 characters, which the compiler warns about truncating. There is a pragma to disable this warning for the current file, but often this warning occurs in system headers, which I'm reluctant to modify. ;-) I also find it troublesome that such simple cases introduce possible software defects, which I'm being warned about, with no way of fixing the problem other than abandoning generics. Further the error messages generated for template errors are quite bad. In one case I tested an iterator using "<" rather than "!=" and was greeted with a cascade of seemingly unrelated messages. Careful code inspection was the only way to find the problem. Finally, I find the syntax of C++ templates rather illegible, but perhaps that's just me. >Is there something specific you believe you can not >do in C++ with regard to these abilities? Its not so much a matter of "can not do" as "can not do quickly", "can not identify the error" and/or "can not read later". ;-) On the latter point, between operator overloading and templates, it is quite easy to (unintentionally) generate very obtuse C++. One thing I'd like to see in both languages is the ability to use a set of non-reserved Unicode symbols for operator overloading, to disambiguate with the normal operator symbols. Terry -- tsikes@netcom.com