comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Derived private interface
Date: Wed, 27 Jul 2011 18:56:26 -0500
Date: 2011-07-27T18:56:26-05:00	[thread overview]
Message-ID: <j0q8jc$o0s$1@munin.nbi.dk> (raw)
In-Reply-To: j0nmqd$voi$1@tornado.tornevall.net

"Jeffrey Carter" <spam.jrcarter.not@spam.not.acm.org> 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.





  reply	other threads:[~2011-07-27 23:56 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05  3:14 Derived private interface Rego, P.
2011-07-05  5:10 ` AdaMagica
2011-07-06  2:24   ` Rego, P.
2011-07-06  4:34   ` AdaMagica
2011-07-06  7:55     ` Georg Bauhaus
2011-07-06  8:30       ` AdaMagica
2011-07-06 12:59         ` Georg Bauhaus
2011-07-06 13:23           ` AdaMagica
2011-07-06 19:06             ` Randy Brukardt
2011-07-06 13:28           ` Simon Wright
2011-07-06 19:45           ` Randy Brukardt
2011-07-06 22:05             ` Georg Bauhaus
2011-07-06 23:56               ` Adam Beneschan
2011-07-07 14:09                 ` Georg Bauhaus
2011-07-07 15:10                   ` Adam Beneschan
2011-07-08  4:29                     ` AdaMagica
2011-07-08 19:08                       ` Randy Brukardt
2011-07-08 19:12                     ` Randy Brukardt
2011-07-07 15:19                   ` Georg Bauhaus
2011-07-07 10:37         ` Stephen Leake
2011-07-07 13:18           ` Georg Bauhaus
2011-07-08 19:23             ` Randy Brukardt
2011-07-08 21:41               ` Jeffrey Carter
2011-07-09  6:14                 ` Dmitry A. Kazakov
2011-07-22 22:59                 ` Randy Brukardt
2011-07-23  7:30                   ` Jeffrey Carter
2011-07-23  9:29                     ` Maciej Sobczak
2011-07-23 10:07                     ` Dmitry A. Kazakov
2011-07-26 21:04                     ` Randy Brukardt
2011-07-26 23:43                       ` Jeffrey Carter
2011-07-27 23:56                         ` Randy Brukardt [this message]
2011-07-28  0:18                           ` Jeffrey Carter
2011-07-28 10:06                         ` Maciej Sobczak
2011-07-28 23:24                           ` Randy Brukardt
2011-07-29  6:45                             ` Simon Wright
2011-07-30  0:04                               ` Randy Brukardt
2011-07-30  6:32                                 ` Simon Wright
2011-08-01  9:30                                   ` Alex R. Mosteo
2011-08-01 10:12                                     ` Dmitry A. Kazakov
2011-08-01 21:56                                       ` Randy Brukardt
2011-08-02 10:03                                         ` Dmitry A. Kazakov
2011-08-02 21:16                                           ` Randy Brukardt
2011-08-03  9:01                                             ` Dmitry A. Kazakov
2011-08-03 20:16                                               ` Randy Brukardt
2011-08-04  8:15                                                 ` Dmitry A. Kazakov
2011-08-09 21:10                             ` Maciej Sobczak
2011-08-09 21:35                               ` Randy Brukardt
2011-08-10  9:11                                 ` Dmitry A. Kazakov
2011-08-10 21:56                                   ` Randy Brukardt
2011-08-11  8:07                                     ` Dmitry A. Kazakov
2011-08-12  4:52                                       ` Randy Brukardt
2011-08-12  8:54                                         ` Dmitry A. Kazakov
2011-08-10 10:07                                 ` Maciej Sobczak
2011-08-10 11:26                                   ` Georg Bauhaus
2011-08-10 22:27                                     ` Randy Brukardt
2011-08-10 22:21                                   ` Randy Brukardt
2011-08-11 13:50                                     ` Maciej Sobczak
2011-08-12  4:43                                       ` Randy Brukardt
2011-08-12  7:00                                         ` Maciej Sobczak
2011-08-12 21:59                                           ` Randy Brukardt
2011-07-06 15:06       ` Adam Beneschan
2011-07-06 16:36       ` Dmitry A. Kazakov
2011-07-06 19:20       ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox