comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcqada@earthlink.net>
Subject: Re: Small question concerning use
Date: Tue, 16 Oct 2001 12:28:46 GMT
Date: 2001-10-16T12:28:46+00:00	[thread overview]
Message-ID: <3BCC1C4F.467ADB81@earthlink.net> (raw)
In-Reply-To: 19130ae.0110151428.65937d5b@posting.google.com

Eric Merritt wrote:
> 
> Hello everyone,
> 
> I am fairly new to Ada, though I already love the language, and I have
> a small question concerning the 'use' keyword. Many books and quite a
> few postings to this group say not to use it at all, even the style
> guide is fairly adamant about avoiding it. Yet, in many packages I see
> it used frequently. Is there a set standard for when to use it and
> when not to use it? I would just as soon not use it at all except some
> packages names get really (really) long. Ok, lets say you don't use
> it, is it then acceptable to use 'rename ' to shorten long package
> names. Which is the more acceptable?

Well, unfortunately discussing the appropriate use of "use" never
results in a "small" discussion :-)  Look back at previous discussion
threads on this topic in this newsgroup and you'll see what I mean.

"Use" is probably more commonly seen in books and postings because it
makes for less cluttered listings of (and this is the key justification)
_SHORT_ sections of code.  In production code you're more interested in
clarity of expression to the reader, so "use" tends to be discouraged.

There seems to be four general approaches, advocates of each of which
have posted in this newsgroup in the past:

1) Use "use" freely and rely on your code browser to look up a reference
when you need it.

2) Use "use" only for "utility" packages, like IO, strings, math
packages, and data structures.

3) Do not use "use", and use "renames" to shorten selected notation
references that start getting really long.

4) Do not use "use", and do not use "renames".  Choose package and
entity names very carefully so that they compose well.

And then there's "use type" to get direct visibility to a type's infix
operators.  Some consider it a godsend, others think it vile.

Marc A. Criley
Senior Staff Engineer
Quadrus Corporation
www.quadruscorp.com



  parent reply	other threads:[~2001-10-16 12:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-15 22:28 Small question concerning use Eric Merritt
2001-10-16  6:34 ` Rename is much better Petter Fryklund
2001-10-16 12:28 ` Marc A. Criley [this message]
2001-10-16 13:27 ` Small question concerning use Ted Dennison
2001-10-16 19:31   ` Darren New
2001-10-16 20:26     ` Ted Dennison
2001-10-16 21:26       ` David Starner
2001-10-17  0:18         ` tmoran
2001-10-17  2:48           ` Darren New
2001-10-17 10:52             ` Larry Kilgallen
2001-10-17 13:48             ` Ted Dennison
2001-10-17 14:21         ` Ted Dennison
2001-10-16 20:35     ` Ted Dennison
2001-10-16 13:54 ` Marin David Condic
2001-10-18 18:46 ` Dr. Michael Paus
replies disabled

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