From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,79bbf7e359159d0d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-06 06:09:39 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!nntp.cs.ubc.ca!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3ACDB29E.45B91316@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: newbie can't get exceptions to work! References: <25%y6.2364$jz.201607@www.newsranger.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 06 Apr 2001 13:09:39 GMT NNTP-Posting-Host: 158.252.122.208 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 986562579 158.252.122.208 (Fri, 06 Apr 2001 06:09:39 PDT) NNTP-Posting-Date: Fri, 06 Apr 2001 06:09:39 PDT Xref: supernews.google.com comp.lang.ada:6557 Date: 2001-04-06T13:09:39+00:00 List-Id: Ted Dennison wrote: > 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