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,3cd94a799504cebd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-16 05:28:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!paloalto-snh1.gtei.net!lsanca1-snf1!news.gtei.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3BCC1C4F.467ADB81@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: Small question concerning use References: <19130ae.0110151428.65937d5b@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 16 Oct 2001 12:28:46 GMT NNTP-Posting-Host: 158.252.122.195 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1003235326 158.252.122.195 (Tue, 16 Oct 2001 05:28:46 PDT) NNTP-Posting-Date: Tue, 16 Oct 2001 05:28:46 PDT X-Received-Date: Tue, 16 Oct 2001 05:24:59 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:14659 Date: 2001-10-16T12:28:46+00:00 List-Id: Eric Merritt wrote: > > 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? Well, unfortunately discussing the appropriate use of "use" never results in a "small" discussion :-) Look back at previous discussion threads on this topic in this newsgroup and you'll see what I mean. "Use" is probably more commonly seen in books and postings because it makes for less cluttered listings of (and this is the key justification) _SHORT_ sections of code. In production code you're more interested in clarity of expression to the reader, so "use" tends to be discouraged. There seems to be four general approaches, advocates of each of which have posted in this newsgroup in the past: 1) Use "use" freely and rely on your code browser to look up a reference when you need it. 2) Use "use" only for "utility" packages, like IO, strings, math packages, and data structures. 3) Do not use "use", and use "renames" to shorten selected notation references that start getting really long. 4) Do not use "use", and do not use "renames". Choose package and entity names very carefully so that they compose well. And then there's "use type" to get direct visibility to a type's infix operators. Some consider it a godsend, others think it vile. Marc A. Criley Senior Staff Engineer Quadrus Corporation www.quadruscorp.com