comp.lang.ada
 help / color / mirror / Atom feed
From: Sven Nilsson <emwsvni@emw.ericsson.se>
Subject: Re: Ada95 tutorials with sample code.
Date: Wed, 07 Mar 2001 08:54:21 +0100
Date: 2001-03-07T08:54:21+01:00	[thread overview]
Message-ID: <3AA5E92D.8446E7AB@emw.ericsson.se> (raw)
In-Reply-To: 3AA48DE9.A0650F21@emw.ericsson.se

Howdy

I'm replying to my own entry here to try and recap some of the things
thats been said. No flaming at all as far as I can see, thank you very
much people!

Most people seem to agree that the use-clause can be a dangerous thing,
but there are voices raised in it's defence:

1. If you write/design your code properly, the use-clause won't be a
problem and will make the program easier to read and maintain.
2. Standard things like Text_Io and Strings should be known to most
Ada-users and in that case a use-clause can be used safely.
3. Using full names means the code will be less readable (this is noted
in the paper "In defence of the use clause" available at
http://www.adalog.fr/publica2.htm and is consistent with what I know of
readablility index and such things (I'm a teacher at heart))

All of these are good solid reasons to use "use", but I do not agree
with them.
The first one would be nice if it worked, but in my experience people
don't think before they do. As I said in my last post, I work in big
projects with a lot of people working on the same code in different
teams, trusting that everyone has the same view of what is proper design
is bordering on stupidity. "Trust is good, control is better" as the old
saying goes.
The second one should be very true indeed. My example in the other post
(with TIO) is pretty stupid, really. BUT clever chaps tend to override
standard things like text_io and strings to add little extra features.
Like Ted I'm often called in to  figure out why things don't work and
I've actually had a case where a badly implemented debug-text_io was the
whole problem...
The third statement is probably the hardest to argue with. Having spent
the last three years reading and writing Ada-code using full names, I've
gown pretty used to "filtering" out the prefixes until I need them, but
as a beginner the code always seemed horrible complicated. That's a
problem...

Other notes that I feel should be pointed out again is

4. The option of "use type", which I agree can be VERY usefull on
occasion.
5. Using "use" in the procedures/functions where it is really needed.

Number 5 is perhaps the way to go. If we can keep our methods (to use a
java term) short (as in K.I.S.S), this could become very readable AND
traceable. I'll have to look into that one further.

The last point I'd like to recap is concerning renaming. Some people
obviously consider this to be the worst thing to befall mankind and
about two years ago I would have agreed. Now, however, we've been using
rename for so long and so extensively that we actually have "renaming
conventions". Almost every file you open have a number of renames at the
top, renaming standard packages that we use extensively. These renames
are ALWAYS the same, which means that it actually becomes quite
readable. So why didn't we name the packages that way to start with, you
might ask. Simple. I know what TEPC is, but you don't. It really is a
package name of some 30 characters (yes, that long) which I don't want
to type and certainly don't want to read everytime it's used, but TEPC
is ok to read and it tells me what I need to know. If you don't know
what TEPC is, you just look it up in the rename section of the package.
This works, but I agree that it's not a perfect world...

So much for the recap. Thank you for all the comments, I'll ponder over
them as I look over our naming conventions and coding principles.

-Sven



  parent reply	other threads:[~2001-03-07  7:54 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 10:38     ` David C. Hoos, Sr.
2001-03-06 15:06       ` Ted Dennison
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
2001-03-07  6:46     ` use-clause Anders Wirzenius
2001-03-07 18:13       ` use-clause Jean-Pierre Rosen
2001-03-07  7:54     ` Sven Nilsson [this message]
2001-03-07 15:10       ` Ada95 tutorials with sample code 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