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-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!news-mue1.dfn.de!news-ham1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Mon, 13 Sep 2004 13:06:19 +0000 (UTC) Organization: GMUGHDU 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: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1095080779 23134 134.91.1.34 (13 Sep 2004 13:06:19 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Mon, 13 Sep 2004 13:06:19 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:3670 Date: 2004-09-13T13:06:19+00:00 List-Id: Kevin Cline wrote: :> 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. OK, if the code has not used proper types right from the start and there will be no corrections, there is little you can do but write adequate code. : But we're not omniprescient. Sure. This is why things can be described in fairly abstract terms. This does *not* mean chosing a concrete type for their representation. If I know "we will be computing with floating point values", I won't blindly chose one concrete predefined floating point type unless there is good reason to do so. In particular when it costs next to nothing to provide for possible changes in the type by making the corresponding module a parameterized module. : 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. As a Client, you won't have to use the name "FPT", see below. : 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. So that's it :-) You want the illusion of knowing the type. :-) And to look at the details by trial and error testing? Given the information present in digits<>, conceptually, and leaving it at that, of course will give you lots of opportunities for additional testing :-) :-) FPT is of course a name chosen for the sake of this example, not to be used in real programs to denote a particulat floating point type. The name does _not_ appear outside the floating point module. In package ... is new Stone_Carving_Drawings (Float_Type => ...); it is pretty clear what Float_Type => ... stands for, isn't it? -- Georg