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!feeder2-1.proxad.net!news18-e.free.fr!not-for-mail Date: Wed, 08 Sep 2004 00:01:34 +0200 From: Lionel Draghi User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.7.2) Gecko/20040820 Debian/1.7.2-4 X-Accept-Language: en-us, it MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request References: <49dc98cf.0408110556.18ae7df@posting.google.com> <6F2Yc.848$8d1.621@newsread2.news.pas.earthlink.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <413e2fbd$0$30586$626a14ce@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 08 Sep 2004 00:01:33 MEST NNTP-Posting-Host: 82.64.158.15 X-Trace: 1094594493 news18-e.free.fr 30586 82.64.158.15:33128 X-Complaints-To: abuse@proxad.net Xref: g2news1.google.com comp.lang.ada:3451 Date: 2004-09-08T00:01:33+02:00 List-Id: jayessay wrote: ... > Exactly. Actually this sort of development will save you much more > time and money than you could ever hope for from typical static typing. How could this be? With powerful typing you write code. Without, you write as much code and much more tests. Let's compare: A : function Random_Index return Integer; -- return's a value between 1 and 10 B : type Index is range 1 .. 10; function Random_Index return Index; If considering code and comments, both are of the same length. On the other hand, in the A version, I need to check the return value on each call. Moreover, if the B Random_Index try to return 11, it will raise Constraint_Error, whatever is the test. If the A version try to return 11 it may be in some other test where you din't check Ramdom_Index result, and you may not notice it. So, not only strong typing save you time and money, but it just do a better job (not to mention possible compiler optimization and preventing the discrepancy risk between comments and code). PS : actually the difference may be even bigger : static code analysis tool may prove that B is correct, in which case you don't even need to test it, and not beeing able to do the same with A because of the missing semantic. -- Lionel Draghi