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 18:03:03 PST Path: archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: mjsilva@jps.net (Mike Silva) Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? Date: 18 Jul 2001 18:03:03 -0700 Organization: http://groups.google.com/ Message-ID: <5267be60.0107181703.4d1266f2@posting.google.com> References: <3B59CD72@MailAndNews.com> <3B5573DA.5ABA8EA7@earthlink.net> NNTP-Posting-Host: 209.239.198.143 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 995504583 1946 127.0.0.1 (19 Jul 2001 01:03:03 GMT) X-Complaints-To: groups-support@google.com NNTP-Posting-Date: 19 Jul 2001 01:03:03 GMT Xref: archiver1.google.com comp.lang.ada:10222 Date: 2001-07-19T01:03:03+00:00 List-Id: Very True! If you use Ada you *will* get spoiled by attributes! Mike "Marc A. Criley" wrote in message news:<3B5573DA.5ABA8EA7@earthlink.net>... > 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