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!aioe.org!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Derived private interface Date: Wed, 27 Jul 2011 17:18:01 -0700 Organization: TornevallNET - http://news.tornevall.net 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: ff5cbc974e507d4d6478c684945636e7 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 723372a4d5edf98f5f47fa4023e5a309 X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=723372a4d5edf98f5f47fa4023e5a309 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: g2news2.google.com comp.lang.ada:21360 Date: 2011-07-27T17:18:01-07:00 List-Id: On 07/27/2011 04:56 PM, Randy Brukardt wrote: > > 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. There are as many options and as many lines of code per option no matter which implementation technique you use. At least with composition they're all together in one place; programming by extension puts them in as many places as there are options, with no links in the code to tell you where they are; the odds of leaving some options unmodified is much greater. As you mentioned later, it doesn't save you any effort, either. > 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. Everyone I know who has worked with code that uses programming by extension misunderstands it at least some of the time. (Perhaps you are an exception.) Composition does not seem to have this problem. -- Jeff Carter "Propose to an Englishman any principle, or any instrument, however admirable, and you will observe that the whole effort of the English mind is directed to find a difficulty, a defect, or an impossibility in it. If you speak to him of a machine for peeling a potato, he will pronounce it impossible: if you peel a potato with it before his eyes, he will declare it useless, because it will not slice a pineapple." Charles Babbage 92