comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Amey <pna@praxis-cs.co.uk>
Subject: Re: Elimination of "use" clauses
Date: 1999/07/13
Date: 1999-07-13T08:48:25+00:00	[thread overview]
Message-ID: <378AFC41.5290E6A0@praxis-cs.co.uk> (raw)
In-Reply-To: 7lj9lb$mos$1@nnrp1.deja.com



Ed Falis wrote:

[snip].
> 
> I have to agree (strongly) with this comment.  There's little reason these
> days not to use such a browsing capability.  This allows you to take
> advantage of the benefit of use clauses:  uncluttering the source text so you
> can easily understand it logic and structure.  With resolution of references
> a click or two away, there's little excuse for long dotted-notation
> references.
> 
> - Ed Falis
> Aonix
> 

There seems to be an assumption in parts of this thread that
"dotted.names" = "long.or.unwieldy.dotted.names".  I don't think that
this has to be the case as long as package and other identifier names
are chosen so that they read well when put together with dots (exactly
as I hope we would when choosing record and field names).  A particular
common area of failure in this respect are "bucket" packages containing
type declarations.  For example, if we have:

package BasicTypes is
  type SwitchType is (On, Off, Unknown);
  type ValveType  is (Open, Closed, Unknown);
end BasicTypes;

then variable declarations take the (horrible) form:

X : BasicTypes.ValveType;
Y : BasicTypes.SwitchType;

and expressions using them become (in the absence of use clauses)
become:

if X = BasicTypes.Open and Y = BasicTypes.Off ...


I think this is much better handled by using more, smaller packages
(recognising that switches and valves are different things) thus:

package Switch is
  type T is (On, Off, Unknown);
end Switch;

package Valve is
  type T is (Open, Closed, Unknown);
end Valve;

which leads to the much nicer declarations:

X : Valve.T;
Y : Switch.T;

and expressions of the form:

if X = Valve.Open and Y = Switch.Off ...


I think it is better to choose names that read nicelty in context than
to use extensive renaming (especially abbreviations) to get round
badly-chosen names.  I think this means I agree with Robert about the
need to control the global name space.

regards


Peter


-- 
---------------------------------------------------------------------------   
      __         Peter Amey, Product Manager
        )                    Praxis Critical Systems Ltd
       /                     20, Manvers Street, Bath, BA1 1PX
      / 0        Tel: +44 (0)1225 466991
     (_/         Fax: +44 (0)1225 469006
                 http://www.praxis-cs.co.uk/

--------------------------------------------------------------------------




  parent reply	other threads:[~1999-07-13  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 ` Samuel T. Harris
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 ` Joe Wisniewski
1999-07-02  0:00 ` Robert Dewar
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 [this message]
1999-07-02  0:00   ` Ted Dennison
1999-07-02  0:00     ` Ed Falis
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             ` jerry
1999-07-19  0:00               ` Vladimir Olensky
1999-07-20  0:00               ` Richard D Riehle
1999-07-20  0:00                 ` Opaque Types (was Elimination of "use" clauses) David C. Hoos, Sr.
1999-07-20  0:00                 ` Elimination of "use" clauses jerry
1999-07-18  0:00             ` Dale Stanbrough
1999-07-20  0:00               ` David Kristola
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-19  0:00             ` Ted Dennison
1999-07-19  0:00               ` Tucker Taft
1999-07-19  0:00                 ` Ted Dennison
1999-07-02  0:00     ` Stephen Leake
1999-07-02  0:00   ` Samuel T. Harris
1999-07-02  0:00     ` Robert Dewar
1999-07-08  0:00       ` R. Tim Coslet
1999-07-09  0:00         ` Robert Dewar
1999-07-09  0:00           ` tmoran
     [not found]       ` <7ltl2q$mog$1@nnrp1.deja.com>
1999-07-08  0:00         ` Michael F. Yoder
1999-07-09  0:00           ` Richard D Riehle
1999-07-09  0:00             ` Marin David Condic
1999-07-09  0:00             ` Michael F. Yoder
1999-07-09  0:00           ` Robert Dewar
1999-07-09  0:00             ` Dale Stanbrough
1999-07-12  0:00               ` Robert Dewar
1999-07-12  0:00                 ` Ted Dennison
1999-07-09  0:00             ` Michael F. Yoder
1999-07-14  0:00               ` Tucker Taft
1999-07-10  0:00             ` Simon Wright
1999-07-12  0:00               ` Robert Dewar
replies disabled

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