comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Small question concerning use
Date: Tue, 16 Oct 2001 09:54:13 -0400
Date: 2001-10-16T13:54:16+00:00	[thread overview]
Message-ID: <9qhe68$8fq$1@nh.pace.co.uk> (raw)
In-Reply-To: 19130ae.0110151428.65937d5b@posting.google.com

This discussion shows up here quite often. Perhaps something should be in
the FAQ?

There is no overall concensus on the issue of "use" clauses. You will find
advantages and disadvantages on either side of the issue. Generally, there
is some concensus that they should be avoided until such time as it starts
to make what you are doing more clear to have the use clause. Start with no
use clause. If you find that you are doing silly things like "X :=
Some_Package."<=" (A, B);" then back off a little and try the "use type" to
make the operations visible. If your code is getting really cluttered with
Long.Confusing.Dotted.Names then you might back off some more. Try to
restrict the use clause to just the scope that needs it to make things more
clear.

OTOH, if you have a use clause for every package you "with" you are really
no worse off than you would be in most other languages and you can always
disambiguate whatever you need to with the dotted notation. Code clarity?
Many modern Ada-oriented editors will help you locate the exact definition
of a thing if/when you get confused - unless the code doesn't yet compile!
:-)

As you develop more code in Ada, you will probably develop a sense of where
to draw the line such that it works well for you. If you're on a joint
project with others, establish & follow some project guidelines on this so
that you are at least consistent.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Eric Merritt" <cyberlync@yahoo.com> wrote in message
news:19130ae.0110151428.65937d5b@posting.google.com...
> 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?
>
> Thank you for your time,
> Eric





  parent reply	other threads:[~2001-10-16 13:54 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 ` Small question concerning use Marc A. Criley
2001-10-16 13:27 ` 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 [this message]
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