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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews2.google.com!not-for-mail From: kevin.cline@gmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: 12 Sep 2004 23:58:59 -0700 Organization: http://groups.google.com Message-ID: References: <49dc98cf.0408110556.18ae7df@posting.google.com> <413e2fbd$0$30586$626a14ce@news.free.fr> <4140b5cc$0$17701$626a14ce@news.free.fr> NNTP-Posting-Host: 24.219.97.214 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1095058739 31030 127.0.0.1 (13 Sep 2004 06:58:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 13 Sep 2004 06:58:59 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3659 Date: 2004-09-12T23:58:59-07:00 List-Id: Georg Bauhaus wrote in message news:... > Kevin Cline wrote: > > : Explicit static typing ala Ada and C++ definitely has a cost, > > Yes. (And you get something in return, too?) > > : because it makes the code longer, > > Sometimes I prefer a few explicit words to brevity when brevity would > hide things away. > > : and also makes it more brittle. > > Hm. Brittle? Your example could be a design issue. > In Ada you could have > written > > generic > type FPT is digits <>; > function compute(x, y: FPT) return FPT; > > or > > generic > type FPT is digits <>; > package Computations is ... Yes, you could have, if you had thought of it before your team wrote 100,000 lines of code. But we're not omniprescient. Sometimes requirements change, and sometimes we make mistakes. This flexibility also comes with a cost -- it makes the code harder to read. Everyone knows what digits<> means, but the first time we see FPT we'll have to go look it up. Should we also create a type for discrete inventory quantity, or just use integer? Well, it's possible that we could need to go to 64 bits, but right now we don't have enough memory to expand them all to 64 bits, so better create a IQTY type. And so it goes... soon you have dozens or hundreds of data types, and no one knows what they all mean, and the code is obscured by type conversions.