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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,971aa11c293c3db1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-18 05:26:01 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3B5573DA.5ABA8EA7@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? References: <3B59CD72@MailAndNews.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 18 Jul 2001 12:25:53 GMT NNTP-Posting-Host: 158.252.122.130 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 995459153 158.252.122.130 (Wed, 18 Jul 2001 05:25:53 PDT) NNTP-Posting-Date: Wed, 18 Jul 2001 05:25:53 PDT X-Received-Date: Wed, 18 Jul 2001 05:23:31 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:10150 Date: 2001-07-18T12:25:53+00:00 List-Id: Vinzent Hoefler wrote: > > Original Message From taw@users.sourceforge.net > > > >- too strong typing > > What? Sorry, but the typing is a great plus. It's true, you have to think a > little more about it when designing types and sometimes this might be a > little > bit annoying ;), but is thinking really that *bad*? > > If nothing helps, there's still the feature of Unchecked Type Conversions. > At least you were warned then. :) My nomination for "Best Kept Secret of Ada" is strong typing. It's almost always viewed as purely a defensive feature--to help avoid type mismatches, and so you have to really think through your types, which can take time, and sometimes be a pain, yadda yadda... Strong typing lets you _embed_information_ into your program, and then get it out again via attributes. Consider this: type Altitude is range 0 .. 50_000; Above_Ground : Altitude; The "defensive" interpretation says that you can now be assured an attempt to assign a negative altitude or go into military airspace will be immediately caught. But look at what you get from the "informational" interpretation: 'First, 'Last, 'Size, 'Range, 'Address, 'Min, 'Max, 'Image, 'Val, 'Pos, 'Value, 'Input, 'Output, 'Read, 'Write, 'Pred, 'Succ, 'Valid, 'Wide_Image, 'Wide_Value, 'Wide_Width, 'Width. And that's just from a simple little scalar type definition. Floating and fixed point types, composite constructs, tasks, and so on, each have their own specific means of embedding and extracting information. Ada's strong typing produces "information dense" code. Simple declarations, like that of Altitude above, inherently provide information that would otherwise have to be explicitly maintained or derived when using other languages. Marc A. Criley Senior Staff Engineer Quadrus Corporation www.quadruscorp.com