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: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public From: Stanley Allen Subject: Re: OO, C++, and something much better! Date: 1997/01/06 Message-ID: <32D0CA27.44C2@ghgcorp.com>#1/1 X-Deja-AN: 208029739 references: <32CCE4ED.6A21@online.no> <5ajo99$khu@panix.com> <32ce7009.280817694@news.zip.com.au> content-type: text/plain; charset=us-ascii mime-version: 1.0 newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng x-mailer: Mozilla 3.0 (Win95; I) Date: 1997-01-06T00:00:00+00:00 List-Id: John (Max) Skaller wrote: > Is C++ innovative? Too right it is. > It has the most powerful support for genericity available > in any widely used commercial language. (Sorry, Ada doesn't count, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You loaded the question, and therefore your dismissal of Ada is the act of knocking down a strawman. Let me engage in some debuking here, and point out that Ada *is* widely used, just not in the PC/GUI world. Ada is also very much a "commercial" language; in fact, many of the companies using Ada today for commercial projects consider it to be a success factor in their software efforts. To hear that C++'s template mechanism is "innovative" and "powerful" comes as a surprise. Parts of the C++ template mechanism look like a borrowing of Ada's "generic" facility (Stroustrup attributes this to Alex Stepanov, who had done a great deal of work with Ada generics before designing the C++ Standard Template Library). Unfortunately, the type system in C++ is too weak to support anything as powerful as Ada's generic facility. The C++ "template argument" (which corresponds to Ada's "generic formal parameter") for a type can only be of the form "class T". In Ada terms, this would be like having all generic formals be "type T is private". In C++, there is no way to 1) specify the kinds of types that may be used to make an instance of the template (for example, to specify that the template may only be instantiated with integer types), or 2) to assume a particular set of operations will be available within the template for the type argument (for example, to assume that integer operations will be availible for a variable of type T). These two issues are the heart and soul of Ada generics (derived as they are from Ada's type system), and provide a powerful tool for specifying complete "contracts" between the generic developer and user. The C++ mechanism boils down in practice to a "macro-expansion" tool. -- Stanley Allen mailto:sallen@hso.link.com