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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-05 07:45:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Reply-To: "James S. Rogers" From: "James S. Rogers" Newsgroups: comp.lang.ada References: <3E147D79.2070703@cogeco.ca> <4519e058.0301031434.51a0c880@posting.google.com> Subject: Re: Anybody in US using ADA ? One silly idea.. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Sun, 05 Jan 2003 15:45:46 GMT NNTP-Posting-Host: 12.86.35.7 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1041781546 12.86.35.7 (Sun, 05 Jan 2003 15:45:46 GMT) NNTP-Posting-Date: Sun, 05 Jan 2003 15:45:46 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:32573 Date: 2003-01-05T15:45:46+00:00 List-Id: "Dmitry A. Kazakov" wrote in message news:av9egl$dd34q$2@ID-77047.news.dfncis.de... > > 1. Generics are static. You cannot have an object or dynamic-link library of > generics. > > 1.a. This kills code reuse at run-time. > > 1.b. You cannot have a true polymorphism with generics. [A fake, "static" > polymorphism was invented to hide the truth.] > > 1.c. You have geometric code size explosion if you consequently use > generics. > > 2. You have no ADT with generics. All generic types are hard-wired. In C++ > you have only one generic type: "class". In Ada there are few: "private", > "range <>" etc. This is Stone Age. Theoretically one could leverage > generics to full ADT, but what for? It is much better to have a better ADT > in the core language and abadon generics. > > 3. Generics are inconsistent with type relationships. When you instantiate > something, this something is absolutely unrelated to everything else. A > generic container instantiated with a subtype will never become a subtype > of same container instantiated with the base type. > > 4. Generics are inconsistent with DbC. In C++ you just instantiate and pray. > In Ada it is better, but still you have reemergence of predefined > operations and other contract violations. The reason is clear, while the > core language operates with types and their relations, generics are sort > of: let's substitute one string for another and see if the result go > through the compiler. I think it was Kernigan and Ritchie who said that > preprocessor does not know C. Substitute generics for preprocessor and > language X for C. > > 5. Generics are unstructured and too powerful. They are comparable with > gotos. Gotos arbitrarely change control flow. Generics arbitrarely produce > new language objects. You can have a generic type, subroutine, package, > everything. The consequences of an instantiation is almost impossible to > predict. As with gotos, you should admit, that a program with generics is > very difficult to understand and maintain. [For C++ replace difficult to > impossible, because of automated instantiation] > > 6. Generics completely fall out of the language, because in fact they form a > meta-langauge. A generic object does not exist for the core language. What > could be done with a generic object? The answer is: nothing. One cannot > pass a generic function as a parameter to a normal function. Even a generic > parameter cannot be generic (:-)), only instances [= objects of the core > language] are allowed. So even as a meta-language, generics represent an > inconsistent one. > Are you also against the use of abstract tagged types? Jim Rogers