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,d89b08801f2aacae X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-02 16:53:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3CD1D17B.F60DCB89@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Is strong typing worth the cost? References: <4519e058.0204290722.2189008@posting.google.com> <3CCE8523.6F2E721C@earthlink.net> <3CCEB246.9090009@worldnet.att.net> <3CCFD76A.A60BB9A8@flash.net> <3CD0A3B8.7B7C8622@san.rr.com> <3CD15FAE.6DEE0AD@despammed.com> <3CD16B60.93078396@san.rr.com> <3CD1B496.DBE8ADC4@san.rr.com> <3CD1BACC.8938FEAB@despammed.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 02 May 2002 23:52:46 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1020383566 66.75.151.160 (Thu, 02 May 2002 16:52:46 PDT) NNTP-Posting-Date: Thu, 02 May 2002 16:52:46 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:23460 Date: 2002-05-02T23:52:46+00:00 List-Id: Wes Groleau wrote: > > > But take, just as a simple example, the "once and only once" rule, which > > says that everything should be stated in exactly one place. Ada fails > > this miserably, on purpose. Ada always has at least *two* declarations > > for every type, and usually a great deal more. > > ?!?!? WHAT in the world are you talking about? type age is integer range 0..50; -- that's one x : age; -- that's two procedure y(yy : age) is -- That's three z : age -- That's four begin z := blah(yy); zilch(z); end y; Now, if I change X to be a date instead of an age, how many places to I need to change it? I need to change it two places in Y's body and one place in Y's header, and Y doesn't even care whether its argument is an age or a date, since it doesn't do anything with it except pass it to other functions. Imagine that blah and zilch each pass it to a couple other modules before something interesting actually happens with it. How many places do you have to touch? It's exactly the same sort of wide-spread changing that OO is supposed to reduce. Contrast this with a similar function for Y in smalltalk: y: yy | z | z <- yy blah { this is like z := blah(yy) } z zilch { this is like zilch(z) } If YY changes from an integer to a disk-based database, you don't have to touch this function, because the type information is irrelevant to the y routine. (Actually, the syntax isn't quite right for the smalltalk, and I don't remember the comment character for smalltalk, but you get the idea.) > > The inability to compile a program that makes reference to functions you > > Ada does not require a subprogram to be written to compile > a call to it. It does require it to be written (or a "stub" > for it) to execute the call. It requires the subprogram to be declared to compile a call to it, and it requires the subprogram to be implemented to link. (The difference between being able to compile and being able to link is kind of academic when the goal is to do both at least five times an hour, so I wasn't really distinguishing all the steps between "finish writing" and "being able to run".) In addition, it requires that you declare all the types you use before you write the code that uses them. For example, you can't compile (let alone link and run) the test that checks that the day before tomorrow is today without declaring your date type, the "tomorrow" routine, the "day before" routine, comparison of dates, and etc. Basically, you can't run a program that makes a call on an undeclared subprogram. Which means you can't write a unit test that fails without touching the the production code. Before you can run a test, you have to already have started to implement the functionality that makes the test pass. This is a no-no. In Smalltalk, for example, the program will run until it gets to the unimplemented call, and pop up a debugger. At that point, you can implement the function called, and then tell the debugger to resume from where it was interrupted. I haven't seen any Ada system that will let you come close to the ease of debugging that Smalltalk allows. > Apparently you are as familiar with Ada > as I am with XP. Err, no. Apparently, you don't understand enough about XP to even have an idea of why Ada is poorly suited to it. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. The 90/10 rule of toothpaste: the last 10% of the tube lasts as long as the first 90%.