comp.lang.ada
 help / color / mirror / Atom feed
From: djones@megatest.UUCP (Dave Jones)
Subject: Re: comments on comments
Date: 23 Feb 89 07:22:23 GMT	[thread overview]
Message-ID: <2325@goofy.megatest.UUCP> (raw)
In-Reply-To: 6093@medusa.cs.purdue.edu

In an article by rjh@cs.purdue.EDU, Bob Hathaway says that he usually
uses ADT's to do top-down design and implementation...

If it works for him, that's great.

I too have been designing all my programs around "abstract data-types"
for some time now, although not since my first program, as he has. 
I started programming for bucks back in '71, when we didn't think of 
such things.  Indeed, I sort of evolved into the practice years later
as a result of much head-scratching. Only afterwards did I discover that
I was not the only one to have dreamed up the technique.

But I don't usually do top-down.  I do bottom-up.  Design, implementation,
test, everything.  It actually shocks some people when I say that. In the
seventies "bottom-up" became a dirty word.  Never mind that top-down
methods resulted in some of the most inflexible code every put to disk.
Top-down good. Bottom-up bad. Unnngghh. :-)

I'll freely admit, there are times when top-down is the way to go.  But
it's not the way I do most of the programs I write by myself.

I start out with a "bottom" that consists of lots of -- okay, I'll go 
along with the name -- ADT's which are likely to be of use in just 
about any kind of program: lists, queues, hash-tables, avl-trees, 
flexible buffers, priority queues and so on.  Next I use these to form 
ADT's which are specific to the low-level objects under consideration, 
etc.  And so it goes from bottom to top.  The payoff comes when you want
to change something. All you have to do is reshuffle these building blocks,
which are still quite useful. But if you go from the top to the bottom, 
a change at the top is likely to invalidate the whole blasted thing.

I sometimes carry it to unlikely extremes.   My group is writing a Pascal 
compiler. If ever there seemed to be a top-down kind of task, that seemed to be
it.  I mean, Pascal is already done, for Pete's sake.  There are standards
documents which tell you what a Pascal compiler absolutely *has* to do. But..
I started out with my bag of standard ADT's anyway, and then defined some
more: Pascal blocks, types, parms, variable-accesses...  just about
every kind of Pascal-object you can think of.  One by one we implemented
them as we worked our way up to type-definitions, expression-trees, statements.
The methods for these ADT's went into a library.

It was only a matter of a few weeks, long before the compiler's high level 
was anywhere near finished, that it paid off.  Another group was doing 
a mouse-driven frontend for the interactive embedded compile/load/go
feature that we have.  They needed to be able to capture all of the 
type-information, formal parameters and so forth about the program being 
run, then fish around in it finding all the variables of this type, 
building all the short expressions that are assignment compatible to the 
second formal parm of procedure foo, etc..   

No problemo.  

Just link with the new Pascal-compiler-library and do yo thang! 
I was psyched.

Try doing that with a Pascal compiler that was designed top-down to
be a Pascal compiler.

  reply	other threads:[~1989-02-23  7:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1813@goofy.megatest.UUCP>
1989-02-10 21:16 ` comments on comments Bob Hathaway
     [not found] ` <20233@agate.BERKELEY.EDU>
     [not found]   ` <9689@ihlpb.ATT.COM>
1989-02-23  2:15     ` Bob Hathaway
1989-02-23  7:22       ` Dave Jones [this message]
1989-02-23 22:50         ` Good Design Strategies <Was comments on comments> Bob Hathaway
1989-02-25  1:07           ` Dave Jones
1989-02-26 19:34             ` Rob Jellinghaus
1989-02-27  0:58               ` William Thomas Wolfe,2847,
1989-02-27 15:29                 ` John Baugh
1989-02-27 18:29                 ` Reuseable Ada components William Thomas Wolfe,2847,
1989-02-28  0:53             ` Good Design Strategies <Was comments on comments> Bob Hathaway
1989-02-28 22:13               ` Dave Jones
1989-03-03  5:45                 ` Bob Hathaway
1989-03-08 17:14                   ` David P. Schneider
1989-03-11 11:15                   ` Stuart H. Ferguson
1989-02-24  1:57         ` comments on comments William Thomas Wolfe,2847,
1989-02-23 20:41       ` comments on comments on reusability Rick Farris
1989-02-24  2:15         ` comments on comments on comments William Thomas Wolfe,2847,
1989-02-24  3:31           ` William A. Bralick
1989-02-24  9:24           ` Rick Farris
1989-02-25 14:28           ` Robert Claeson
1989-03-09 21:12           ` Rick Clements
replies disabled

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