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: a07f3367d7,158ce2376534c35d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!weretis.net!feeder4.news.weretis.net!news.tornevall.net!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Derived private interface Date: Wed, 27 Jul 2011 18:56:26 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <27656578-65aa-48b9-9f89-4ebd4e0cb02a@glegroupsg2000goo.googlegroups.com> <0fe3b0f8-c064-444d-899d-640e891b58c3@w4g2000yqm.googlegroups.com> <128d8eb5-1cc6-47e3-a09b-b53a5ef289ce@m10g2000yqd.googlegroups.com> <4e141501$0$6629$9b4e6d93@newsspool2.arcor-online.net> <4b2728fc-6127-45d8-a314-9fc491701c26@g12g2000yqd.googlegroups.com> <82vcve4bqx.fsf@stephe-leake.org> <4e15b223$0$6541$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1311810988 24604 69.95.181.76 (27 Jul 2011 23:56:28 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 27 Jul 2011 23:56:28 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 Xref: g2news2.google.com comp.lang.ada:21358 Date: 2011-07-27T18:56:26-05:00 List-Id: "Jeffrey Carter" wrote in message news:j0nmqd$voi$1@tornado.tornevall.net... > On 07/26/2011 02:04 PM, Randy Brukardt wrote: ... > and record_definition includes "null record", so these are all extensions > and > examples of programming by extension. I wouldn't have thought that I'd > have to > define what I meant when using an Ada term with you. I wasn't thinking of it as an Ada term. My mistake. >> Others have pointed out that using case statements as you suggested is >> essentially worthless unless you know every entity that the program is >> going >> to process before the fact. And real world programs are not like that (I >> have >> plenty of experience changing hundreds of case statements each time we >> make a >> change in node types or intermediate code definitions in Janus/Ada). > > Yes, it's called "design", and it's part of what distinguishes S/W > engineers > from coders. As you note, it's an iterative process. The extra work and > extra > code is worth it for the significant improvement in ease of reading and > understanding that results. I don't agree; the 30 page case statements found in our optimizer and some other parts of our compiler don't add anything to ease of reading! And there is no choice with case statements, you have to have a bunch of lines for each option; when there are literally hundreds of options there is no way to simplify. And updating those cases typically takes about a week's work; it is so time consuming that we avoid making changes to the intermediate code if any workaround can be found even when that is the best solution to a problem. Ada 2012 will help a tiny bit by providing useful set subtypes (even if they aren't called that), so at least it will be possible to give a name to groups of discontiguous enumerations and that will reduce the work in some cases. I admit that dispatching takes a leap of faith ("it just works" when used properly), and not everyone seems to be able to understand it. But having a lot less code in the critical parts of the application should help understanding. Note that OOP (at least in Ada) does not really provide an answer for the "it takes a week to modify" problem. The Claw Builder (a full OOP design) has a similar problem in the other dimension, in that defining all of the needed overrides also takes a week or so. And in neither case (OOP or non-OOP) is is usefully possible to do just part of the work (as an agile programmer such as myself would prefer) -- neither program will even compile until all of the overridings or case statements are defined. Either way, Ada makes it too hard to add new abstractions to an existing set. Randy.