comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcqada@earthlink.net>
Subject: Re: newbie can't get exceptions to work!
Date: Fri, 06 Apr 2001 13:09:39 GMT
Date: 2001-04-06T13:09:39+00:00	[thread overview]
Message-ID: <3ACDB29E.45B91316@earthlink.net> (raw)
In-Reply-To: 25%y6.2364$jz.201607@www.newsranger.com

Ted Dennison wrote:

  <snips>

> This is a very good example of why "newbies" should be discouraged from using
> the "use" clause. It just adds a whole extra possible level of confusion and
> screw-ups. Some people (myself included) believe that "use" should almost never
> be used. But even those who disagree with that view would agree that it has to
> be used wisely. 

I started out with the position that "use" should almost never be used,
but have been experimenting with a more liberal approach recently.

I was very pleased with the addition of "use type" to Ada 95, despite
the opinion of a some that it's an ugly addition that was included
merely to avoid having to write "renames" clauses for operators.  To me,
not having to write such renames clauses de-clutters the code, improving
its appearance and readability.

Some time ago I'd heard advocacy of using "use" clauses for
service/support packages.  E.g., string packages, time packages, data
structure packages.  I'd bought into that, and even put it into some of
the Ada programming standards I've worked on over the last few years.

Lately I've been trying out the approach that Dewar has advocated: 
Liberal use of the use clause, and rely on your source code browser to
locate definitions.  I haven't made up my mind on this approach yet.  On
the one hand, a lot of verbosity is omitted, especially when dealing
with hierarchical libraries:     

   SetUserObject(Top, Component_Node);

is still quite clear without qualifying the whole procedure call:

   Javax.Swing.Tree.DefaultMutableTreeNode.SetUserObject
        (Top, Component_Node);

...especially when you're making lots of invocations of procedures
provided by a number of hierarchical packages that are just as deep. 
Qualifying every such reference results in very dense blocks of text.

(I know about the possiblity of renaming packages to an abbreviation,
but I simply have an aversion to acronyms in code.  You have to know or
be able to figure out what it stands for, you run the risk of
abbreviating the same package different ways in different places, and I
recall some Ada presentation where it was noted that the language
designers consciously chose to spell out language terms--hence
"character" instead of "char".  So with me it's sort of an
all-or-nothing approach, either qualify it properly or don't at
all--don't confuse me with acronyms.)

On the other hand, in order to use the browser, the code has to compile,
and if I'm in the middle of performing open source surgery on a package
and want to check out a type definition or procedure spec, the package
is in no condition to compile and so I don't have access to the
browser.  At least not with Emacs/GLIDE.

We'll see...

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



  parent reply	other threads:[~2001-04-06 13:09 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-05  3:19 newbie can't get exceptions to work! Jeff Shipman
2001-04-05  4:25 ` Ed Falis
2001-04-05 11:00   ` martin.m.dowie
2001-04-05 14:21     ` Ted Dennison
2001-04-05 17:50       ` Fraser Wilson
2001-04-05  4:34 ` Jeff Shipman
2001-04-05  4:59 ` Wilhelm Spickermann
2001-04-05 14:14   ` Ted Dennison
2001-04-05 16:37     ` Wilhelm Spickermann
2001-04-06 13:09     ` Marc A. Criley [this message]
2001-04-06 15:04       ` Ted Dennison
2001-04-06 16:43       ` Robert A Duff
2001-04-06 17:39         ` Ted Dennison
2001-04-06 21:50           ` Robert A Duff
2001-04-06 20:11         ` Brian Rogoff
2001-04-06 22:20           ` Robert A Duff
2001-04-06 23:04             ` Brian Rogoff
2001-04-07  5:48               ` Jeffrey Carter
2001-04-10  1:29                 ` Robert A Duff
2001-04-07 19:30               ` Robert A Duff
2001-04-07 21:17                 ` Brian Rogoff
2001-04-07 21:25                   ` Ayende Rahien
2001-04-07 22:57                     ` David Starner
2001-04-08 12:10                       ` Ayende Rahien
2001-04-08  2:12                     ` Larry Hazel
2001-04-08 12:12                       ` Ayende Rahien
2001-04-09 16:20                         ` Larry Hazel
2001-04-10  2:38                           ` Ayende Rahien
2001-04-10  3:25                             ` James Rogers
2001-04-08 22:18                       ` Brian Rogoff
2001-04-09 15:14                         ` Ted Dennison
2001-04-09 17:23                           ` Brian Rogoff
2001-04-09 18:23                             ` Laurent Guerby
2001-04-09 19:15                               ` Brian Rogoff
2001-04-10 18:21                                 ` Laurent Guerby
2001-04-10 19:44                                   ` Brian Rogoff
2001-04-11 18:03                                     ` Laurent Guerby
2001-04-11 18:33                                       ` Samuel T. Harris
2001-04-14  0:06                                         ` Robert A Duff
2001-04-12  1:42                                       ` Mike Silva
2001-04-12  2:38                                       ` Brian Rogoff
2001-04-12 23:23                                         ` Laurent Guerby
2001-04-13  2:44                                           ` Brian Rogoff
2001-04-11 13:24                                   ` Ayende Rahien
2001-04-11 13:14                                     ` Mats Karlssohn
2001-04-11 15:08                                       ` Ayende Rahien
2001-04-11 21:42                                       ` Fraser Wilson
2001-04-12 23:55                                         ` Robert A Duff
2001-04-10  2:12                               ` Robert A Duff
2001-04-10  3:47                                 ` Brian Rogoff
2001-04-10 13:40                                 ` Ada keywords (was: Re: newbie can't get exceptions to work!) Marin David Condic
2001-04-10 14:26                                   ` Jean-Pierre Rosen
2001-04-09 20:49                             ` newbie can't get exceptions to work! Ted Dennison
2001-04-09 21:44                               ` Brian Rogoff
2001-04-09 21:59                                 ` Ted Dennison
2001-04-10  2:54                                   ` Ayende Rahien
2001-04-10 14:00                                     ` Ted Dennison
2001-04-10 17:44                                     ` Fraser Wilson
2001-04-10  6:59                               ` Mats Karlssohn
2001-04-10 14:18                                 ` Ted Dennison
2001-04-10 16:27                                   ` Mark Biggar
2001-04-11 11:55                                     ` Mats Karlssohn
2001-04-11 14:34                                       ` Samuel T. Harris
2001-04-11 15:50                                         ` Pat Rogers
2001-04-12  6:27                                         ` Mats Karlssohn
2001-04-11 11:49                                   ` Mats Karlssohn
2001-04-11 15:38                                     ` Robert A Duff
2001-04-13 16:12                             ` Matthew Woodcraft
2001-04-10  1:41                   ` Robert A Duff
2001-04-10  3:03                     ` James Rogers
2001-04-10  3:58                       ` Brian Rogoff
2001-04-10 21:48                         ` Ted Dennison
2001-04-11 15:09                           ` Ayende Rahien
2001-04-11 21:57                             ` James Rogers
2001-04-11 23:13                               ` Brian Rogoff
2001-04-12  6:33                                 ` Mats Karlssohn
2001-04-12 16:38                                   ` Brian Rogoff
2001-04-17  7:04                                     ` Mats Karlssohn
2001-04-17  9:08                                       ` Jean-Pierre Rosen
2001-04-12 15:16                               ` Ted Dennison
2001-04-12 21:22                                 ` James Rogers
2001-04-10  4:26                     ` Brian Rogoff
2001-04-11 15:30                       ` Robert A Duff
2001-04-11 17:33                         ` Brian Rogoff
2001-04-10  1:26               ` Robert A Duff
2001-04-10  2:11                 ` Brian Rogoff
2001-04-14  0:00                   ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
2001-04-05  5:26 Christoph Grein
replies disabled

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