comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Ada95 tutorials with sample code.
Date: Wed, 07 Mar 2001 06:44:38 GMT
Date: 2001-03-07T06:44:38+00:00	[thread overview]
Message-ID: <3AA5D8CA.8F621003@acm.org> (raw)
In-Reply-To: 3AA48DE9.A0650F21@emw.ericsson.se

Sven Nilsson wrote:
> 
> I'm sorry if I disrupt this thread with a slightly off-topic question
> (which I'm sure has been discussed countless times before) BUT
> 
> This use-thingy. Is it really ant good? I've only ever used Ada in HUGE
> projects with loads of people writing the code and I've found that the
> use-clause can be a real pain as it dosn't give you a clue as to where
> things are declared. Right now I'm teaching new arrivals about Ada 95
> and I invariably tell them NOT to use the use-clause.
> Now, there're a lot of very clever and skilled people reading this
> news-group and I'd be interested in your feelings on "use". Is it a Do
> or Don't? Generally speaking?

You're right: This has been discussed to death several times. Judging by
the number of responses you got, we're going to discuss it to death
again.

My rule is: use "use" when it makes the code easier to read. I assume
everyone using Ada is familiar with Ada.Text_IO, so I have no problem
with using it. People will know where Put, Get, and so on come from.

Some packages are designed to be used; a good example is
Ada.Strings.Unbounded. There is a type "Unbounded_String" and an
operation "To_Unbounded_String", for example. It is obvious where these
come from, so "use" is appropriate. Not using these packages results in
redundant names such as Strings.Unbounded.Unbounded_String, which I
think is less readable than using the package.

Other packages are intended NOT to be used. Using these packages will
make your code impossible to understand. As an example, the PragmAda
Reusable Components (see

http://home.earthlink.net/~jrcarter010/pragmarc.htm

or the mirror at www.adapower.com) have a number of ADTs with the type
named "Handle". Obviously, using (an instantiation of) one of these will
get ugly pretty quickly. Using more than one will make you use the
package names anyway.

-- 
Jeff Carter
"Son of a window-dresser."
Monty Python & the Holy Grail



  parent reply	other threads:[~2001-03-07  6:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-05 20:40 Ada95 tutorials with sample code mcdoobie
2001-03-05 20:58 ` Erik Sigra
2001-03-06  2:45 ` Jeffrey Carter
2001-03-06  7:12   ` Sven Nilsson
2001-03-06  8:09     ` tmoran
2001-03-06 10:38     ` David C. Hoos, Sr.
2001-03-06 15:06       ` Ted Dennison
2001-03-06 10:38     ` David C. Hoos, Sr.
2001-03-06 15:29     ` Robert A Duff
2001-03-06 16:54       ` Ted Dennison
2001-03-06 15:48     ` Ted Dennison
2001-03-06 18:19       ` Robert A Duff
2001-03-06 21:19         ` Ted Dennison
2001-03-08  6:13         ` Simon Wright
2001-03-10 16:30           ` Brian Rogoff
2001-03-06 18:20     ` Jean-Pierre Rosen
2001-03-06 20:10       ` Erik Sigra
2001-03-07 14:31         ` Simon Pilgrim
2001-03-06 21:47       ` Ted Dennison
2001-03-07  0:11     ` Robert C. Leif, Ph.D.
2001-03-07  6:44     ` Jeffrey Carter [this message]
2001-03-07  6:46     ` use-clause Anders Wirzenius
2001-03-07 18:13       ` use-clause Jean-Pierre Rosen
2001-03-07  7:54     ` Ada95 tutorials with sample code Sven Nilsson
2001-03-07 15:10       ` Marin David Condic
2001-03-08  0:05       ` Mark Lundquist
2001-03-06 15:03   ` Marin David Condic
2001-03-06 14:31 ` BSCrawford
2001-03-06 22:38   ` mcdoobie
  -- strict thread matches above, loose matches on Subject: below --
2001-03-06 23:51 Beard, Frank
2001-03-06 23:58 Beard, Frank
     [not found] <01030621102401.00302@a77>
2001-03-07 12:09 ` Mario Amado Alves
     [not found] <Pine.LNX.4.10.10103071153320.971-100000@lexis.di.fct.unl.pt>
2001-03-07 13:12 ` Erik Sigra
2001-03-07 18:07   ` Jean-Pierre Rosen
replies disabled

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