comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: Elimination of "use" clauses
Date: 1999/07/09
Date: 1999-07-08T19:29:14-05:00	[thread overview]
Message-ID: <7m3foq$nuj@dfw-ixnews14.ix.netcom.com> (raw)
In-Reply-To: 3784DC54.6463EDCA@decada.zko.dec.com

In article <3784DC54.6463EDCA@decada.zko.dec.com>,
	"Michael F. Yoder" <yoder@decada.zko.dec.com> wrote:

>Not a strawman.  The best ways of dealing with use clauses are what I
>call "Tony Tye" methods (since he devised the first one I used) and make
>package renamings a staple.

This is a widely used technique.  It does not completely solve the 
use clause question.   What problem are we trying to solve?

Ada is unique in its separation of scope from visibility.  In any
other language we would not even be discussing this issue.  As 
noted earlier, the rules of Ada are analogous to default insulation on
every entity.  With most languages we have code that is the equivalent
of bare wires running all over the place.  Cavalier coding of the use
clause is the same as removing all that nice insulation.

Ada permits us to remove the insulation at appropriate places. We would
never expect a consumer to go around scraping insulation from electrical
wires in the home.  We should not expect clients of packages to do the
same.  Instead, we should carefully expose, in our package design, those
places where entities can safely connect with each other.  This is a key
difference between engineering and programming.  

The use clause, when invoked willy-nilly, exposes too much of the
bare wire.  The use type is not much better, but one can see its
usefulness in teaching environments.  At the same time, excessive
paranoia over the use clause is usually unwarranted.  

In my earlier posting on this topic I said that the designer, not the
client/consumer, should be responsible for deciding what should be 
exposed and what should be hidden.  That is the purpose of creating
restricted operator packages that can be referenced via the use clause.
If a package is properly designed, the use clause applied to the 
restricted set of operators will be both easier to "use" and safer than
many of the alternatives.  We as designers need to take responsibility
for this.  Admittedly, most Ada packages in the existing software
repositories have fallen short in addressing this issue.  We can correct
this in future designs.

Richard Riehle
richard@adaworks.com
http://www.adaworks.com





  parent reply	other threads:[~1999-07-09  0:00 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-01  0:00 Elimination of "use" clauses Dr. Neil C. Audsley
1999-07-01  0:00 ` Joe Wisniewski
1999-07-01  0:00 ` czgrr
1999-07-01  0:00   ` Ted Dennison
1999-07-02  0:00     ` czgrr
1999-07-02  0:00       ` Ted Dennison
1999-07-01  0:00 ` Samuel T. Harris
1999-07-02  0:00 ` Robert Dewar
1999-07-02  0:00   ` Ted Dennison
1999-07-02  0:00     ` Ed Falis
1999-07-02  0:00     ` Stephen Leake
1999-07-02  0:00     ` Robert Dewar
     [not found]       ` <7ltus1$ah1@dfw-ixnews19.ix.netcom.com>
1999-07-13  0:00         ` Robert A Duff
1999-07-18  0:00           ` Richard D Riehle
1999-07-18  0:00             ` Dale Stanbrough
1999-07-20  0:00               ` Richard D Riehle
1999-07-19  0:00                 ` Brian Rogoff
1999-07-20  0:00                   ` Robert Dewar
1999-07-20  0:00                     ` Brian Rogoff
1999-07-21  0:00                       ` Ted Dennison
1999-07-21  0:00                         ` Robert Dewar
1999-07-21  0:00                         ` Robert A Duff
1999-07-21  0:00                       ` Robert Dewar
1999-07-21  0:00                         ` Brian Rogoff
1999-07-22  0:00                           ` Robert Dewar
1999-07-22  0:00                             ` Brian Rogoff
1999-07-22  0:00                           ` Robert Dewar
1999-07-22  0:00                             ` Brian Rogoff
1999-07-21  0:00                     ` Robert A Duff
1999-07-21  0:00                       ` Michael F. Yoder
1999-07-21  0:00                         ` Robert A Duff
1999-07-23  0:00                 ` Tucker Taft
1999-08-03  0:00                   ` Richard D Riehle
1999-07-20  0:00               ` David Kristola
1999-07-18  0:00             ` jerry
1999-07-19  0:00               ` Vladimir Olensky
1999-07-20  0:00               ` Richard D Riehle
1999-07-20  0:00                 ` jerry
1999-07-20  0:00                 ` Opaque Types (was Elimination of "use" clauses) David C. Hoos, Sr.
1999-07-19  0:00             ` Elimination of "use" clauses Ted Dennison
1999-07-19  0:00               ` Tucker Taft
1999-07-19  0:00                 ` Ted Dennison
1999-07-02  0:00   ` Ed Falis
1999-07-03  0:00     ` Joe Wisniewski
1999-07-03  0:00       ` Ed Falis
1999-07-03  0:00       ` Keith Thompson
1999-07-13  0:00     ` Peter Amey
1999-07-02  0:00   ` Samuel T. Harris
1999-07-02  0:00     ` Robert Dewar
     [not found]       ` <7ltl2q$mog$1@nnrp1.deja.com>
1999-07-08  0:00         ` Michael F. Yoder
1999-07-09  0:00           ` Robert Dewar
1999-07-09  0:00             ` Michael F. Yoder
1999-07-14  0:00               ` Tucker Taft
1999-07-09  0:00             ` Dale Stanbrough
1999-07-12  0:00               ` Robert Dewar
1999-07-12  0:00                 ` Ted Dennison
1999-07-10  0:00             ` Simon Wright
1999-07-12  0:00               ` Robert Dewar
1999-07-09  0:00           ` Richard D Riehle [this message]
1999-07-09  0:00             ` Marin David Condic
1999-07-09  0:00             ` Michael F. Yoder
1999-07-08  0:00       ` R. Tim Coslet
1999-07-09  0:00         ` Robert Dewar
1999-07-09  0:00           ` tmoran
replies disabled

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