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: Richard D Riehle Subject: Re: Ada Date: 2000/01/04 Message-ID: <84tfco$ko$1@nntp5.atl.mindspring.net>#1/1 X-Deja-AN: 568256270 References: <38620350.48F8FC08@gecm.com> <83tohh$q2s$1@nnrp1.deja.com> <83u8l0$5i5$1@nnrp1.deja.com> <84rd2f$snm$1@nntp3.atl.mindspring.net> <84rphr$ql5$1@nntp8.atl.mindspring.net> Organization: MindSpring Enterprises X-Server-Date: 4 Jan 2000 18:50:00 GMT Newsgroups: comp.lang.ada Date: 2000-01-04T18:50:00+00:00 List-Id: In article , Hyman Rosen wrote: >Richard D Riehle writes: > >You have not read the literature correctly, or you have not read the >correct literature :-) C++ templates can be (according to the standard, >but not yet in reality) separately compiled, I guess it is not just my reading of the compiler publishers manuals that prevent me from doing the same thing I can do in Ada. Also, I am not sure that, once this is implemented in C++, it will correspond to the same level of error checking possible in Ada generics. One of the essential points in Ada is that error checking is not just a function of type-safety. Often overlooked is the extensive set of rules on Scope and Visibility in Chapted 8 of the ALRM. C++ does not seem to be quite as comprehensive on this point. Meanwhile, my C++ programs must correspond to what the compiler publishers allow rather than the theoretical permissions of the standard. >> Ada has more formats for generic formal parameters. This has its >> advantages and may sometimes have disadvantages. The designer needs >> to learn more idioms of the language. Once having learned those idioms, >> more options for template design are available. > >C++ has essentially *no* format for its generic formals, which are >types, templates, or constants. I think that allows C++ to achieve >the same things with its templates that Ada can. As mentioned in my earlier post, I agree that when using the word "can" nearly every language _can_ accomplish whatever any other language _can_. The issue, when comparing languages, should never be whether something _can_ be expressed in this or that language. Rather, the issue is how easily that something can be expressed. It is the difference between expressibility (can express) and expressiveness (designed to express). A caution is in order. An earlier critique of Ada in this forum suggested that Ada is not as _intuitive_ as C++. The author of that criticism confused the notion of _intuitive_ with the notion of _superficial_. Expressive does not necessarily mean _intuitive_. Also, I do not mean to imply that you, Hyman, are superficial. It is clear that you think carefully and deeply about these issues. There are many programming constructs for which COBOL is more expressive, others for which Smalltalk is more expressive, and some for which Ada is not as expressive as C++ or Eiffel. We simply have not yet achieved perfection in the design of programming languages. However, as you noted in you post, Ada does have some advantages of expressiveness, as does C++. I continue to prefer the Ada approach, even though I am currently spending more time coding C++ than I would want. >I hold that a C++ class is more-or-less equivalent to an Ada package, >so a generic formal package in Ada would simply correspond to a generic >formal class in C++. I will agree with this. I suspect that, if templates had been designed into C++ from the beginning, they might be a little better than they are. I find the Ada generic slightly more expressive, for my taste, than the C++ template. Fortunately, not all of us on this planet are identical so there is room for more than one viewpoint on this subject. Richard Riehle