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,897417b380f5731e X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: Re: STL, Ada, C++ (Was Re: The Next Microsoft?) Date: 2000/05/09 Message-ID: <8f83i2$osk$1@slb1.atl.mindspring.net>#1/1 X-Deja-AN: 620962119 References: <8eg37k$15n$1@nnrp1.deja.com> <8epkoa$b8b$1@nnrp1.deja.com> <8eu0ob$7qv$1@nnrp1.deja.com> <391328F0.1221@synquiry.com> <39133213.64A@Ganymede.com> <8f50hc$hpo$1@nnrp1.deja.com> Organization: MindSpring Enterprises X-Server-Date: 9 May 2000 04:18:10 GMT Newsgroups: comp.lang.ada Date: 2000-05-09T04:18:10+00:00 List-Id: In article , Hyman Rosen wrote: >Robert Dewar writes: >> I am not at all convinced that automatic instantiation is >> a help to the reader and maintainer, on the contrary, it >> seems very awkward to have uses of templates not be visible >> from this point of view. > >I consider automatic instantiation of templates to be the compile-time >polymorphism equivalent of run-time dispatching on class-wide types. >When you make a dispatching call, you do not know what function you >are calling. Similarly, you should be able to call a generic function >without explicitly stating which one you are calling. I wonder if there is a trade-off here between convenience and type safety. Ada tends to lean heavily in the direction of safety, and automatic instantiation seems not quite as focused on that issue. For example, the model for generic formal package parameters in Ada forces the designer to create a generic signature package corresponding to the parameter. This makes automatic instantiation quite difficult to achieve, but has the benefit of pretty thorough compile-time evaluation of all the elements of the signature. The goals of C++ are different from those of Ada. If a programmer feels more comfortable with C++ goals, then C++ is a good choice. If someone feels better with the goals of Ada, then Ada should be the choice. Also, those goals are intended to satisfy different levels of confidence in the final product. Would anyone who knows C++ well feel comfortable knowing the software for the avionics on their aircraft was programmed in C++? Most of those I ask, say, "No way." Ada is targeted to exactly that kind of application environment. Scaling back a bit from that extreme, Ada still inspires a greater sense of confidence in its goals than C++ when safety is an issue. Automatic instantiation does not inspire confidence, but that may not matter if a software failure does not kill or maim anyone. Richard Riehle