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!news15-e.free.fr!not-for-mail Date: Fri, 10 Sep 2004 22:54:22 +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: static typing and test-first development References: <49dc98cf.0408110556.18ae7df@posting.google.com> <6F2Yc.848$8d1.621@newsread2.news.pas.earthlink.net> <413e2fbd$0$30586$626a14ce@news.free.fr> <9snhizowcwg9.16smaxkxhyu67$.dlg@40tude.net> <413f770d$0$30111$626a14ce@news.free.fr> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <414214cf$0$32632$636a15ce@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 10 Sep 2004 22:55:49 MEST NNTP-Posting-Host: 82.254.227.43 X-Trace: 1094849749 news15-e.free.fr 32632 82.254.227.43:35541 X-Complaints-To: abuse@proxad.net Xref: g2news1.google.com comp.lang.ada:3568 Date: 2004-09-10T22:55:49+02:00 List-Id: jayessay wrote: ... > I'm not sure which part you are having trouble with. Let's try this > (admittedly somewhat handwavy, but intended to help get the ideas): > Thank you for your explanation, I will read it carefully. ... > >>My point is that with static typing, most type related problems are >>caught at compil time, before any execution. >>Know, you say here that it is possible to write annotation to reach >>the same confort level in Lisp. >>Could you explain me how is this supposed to save time and money? > > It is the extreme flexibility and interactive nature of the > development with continual checking that is the big time saver and bug > eliminator (both type and logic). The type annotation you can do does > not save you any development time (it actually costs time - just like > with static typing), it can save you runtime cycles by allowing the > compiler to perform more optimizations. I consider the later as a side effect and dont give it more importance. On the former, I disagree on the cost. I am maybe writing Ada code for a too long time, but, for me, it's free! :-) When I write code, if I write the word "Integer", I immediatly feel guilty. Because I am infringing some ancestral rules that I don't understand? No. I feel guilty, because I know I am trying to mask a problem. I feel guilty, because I am trying to avoid thinking of the limits and true nature of this Integer. I feel guilty, because my 15 years coding experience is whispering me "Hey, lazzy Lionel, how many time did you try this in the past? Each time it cost you twice as time later! Don't let this mine in the code, solve the problem right now!". If I don't have all the informations handy, I create a new type: type Enum is (TBD); or type Index is range 0 .. 0; so that I can't forget it. (You may prefer more sofisticated solution, like the TBD package). At least, I won't mix oranges and apples. What alternative do I have? 1 - put the type informations in the comments 2 - put the type informations in the test (at least implicitly) 3 - put the type informations... nowhere I suppose we agree that 3 is just a kind of virtual suicide. But either a and b are longer to write and less powerful. So... > The really key thing here is that you develop by testing _everything_ > in a very well scoped and limited unit at each incremental stage. I > realize this is hard to get a grip on unless you've done it - Let's discuss on this in another thread :-) > especially coming from a global static type kind of mind set. I don't understand this, so I can't swear I am not in :-) But I think there is no relation between the typing usefulness and the development process. The only case I know that really decrease typing utility, is when the code is fully generated and formaly proved. But in this case, the whole programming languages is less important. I you discuss strong typing utility, we disagree on this point, that's it, OK. But I think you will have also without XP practices. -- Lionel