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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,ef0074ec236ba6e3 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,b19fa62fdce575f9 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,ef0074ec236ba6e3 X-Google-Attributes: gid1108a1,public X-Google-Thread: 1014db,ef0074ec236ba6e3 X-Google-Attributes: gid1014db,public X-Google-Thread: 108717,ef0074ec236ba6e3 X-Google-Attributes: gid108717,public X-Google-ArrivalTime: 1994-12-05 11:35:52 PST Newsgroups: comp.lang.ada,comp.lang.c,comp.programming,comp.lang.c++,comp.object Path: bga.com!news.sprintlink.net!howland.reston.ans.net!news2.near.net!noc.near.net!inmet!dsd!bobduff From: bobduff@dsd.camb.inmet.com (Bob Duff) Subject: Re: Why don't large companies use Ada? Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: <3aa7jo$7j@Starbase.NeoSoft.COM> <3bjf2q$i69@goanna.cs.rmit.oz.au> <3bvadv$66p@holly.csv.warwick.ac.uk> Date: Mon, 5 Dec 1994 19:10:39 GMT Xref: bga.com comp.lang.ada:8291 comp.lang.c:33435 comp.programming:5630 comp.lang.c++:39670 comp.object:9450 Date: 1994-12-05T19:10:39+00:00 List-Id: In article <3bvadv$66p@holly.csv.warwick.ac.uk>, Jules wrote: >In article , > bobduff@dsd.camb.inmet.com (Bob Duff) writes: >>In article <3bjf2q$i69@goanna.cs.rmit.oz.au>, >>Michael Coburn wrote: >>>house@helios.usq.EDU.AU (ron house) writes: >>> >>>>How about "Ada - use it when you want to multiply a length by a length >>>>and get a length, or when you want to be prevented from dividing an area >>>>by a length because they have different types." >>> >>>total_area := area(length_one) * area(length_two); >>> >>>yawn.... >> >>The fact remains that Ada's type model disallows a sensible operation >>(Total_Area := Length_One * Length_Two), and allows nonsense >>(Some_Length := Length_One * Length_Two). > >Only if you want to go completely over the top and define new types for lengths >and areas. But if you *don't* go over the top in that manner, then Ada allows *both* of the above (one sensible, the other nonsense). Neither usage of the type system gives "perfect" results -- i.e. allow all sensible operations while disallowing all nonsensical operations. That's what type checking is *for*, IMHO, and here's a case where it doesn't quite work right. There's no point in pretending that Ada's type system is perfect -- probably none is at this early point in the history of Programming Language Design. > ...I mean, if you did the same in C++ you would get the same results. Umm, I'm not sure how you do "the same" in C++, since one doesn't generally define new integer types in C++. But I agree that C++ is no better than Ada in this respect. >So why criticise Ada, for something which almost all commonly used languages >today have a problem with, if you use them in this (unusual) manner? I don't think honestly admitting to a minor flaw in Ada's type system is such a bad thing. I'm a language designer, and I like to think about how one might do better. - Bob -- Bob Duff bobduff@inmet.com Oak Tree Software, Inc. Ada 9X Mapping/Revision Team (Intermetrics, Inc.)