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,577df5d4a0e88785 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-15 12:54:36 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out.usenetserver.com!newshub2.rdc1.sfba.home.com!news.home.com!sjc1.nntp.concentric.net!newsfeed.concentric.net!news.he.net!mercury.cts.com!newsfeed.cts.com!cheetah.visicom.com!usenet From: Wayne Lydecker Newsgroups: comp.lang.ada Subject: Re: Bad coding standards Date: Fri, 15 Dec 2000 12:43:30 -0800 Organization: visicom labs, san diego ca, usa Message-ID: <3A3A8272.30052FAD@mtws.visicom.com> References: <910u3p$v9j$1@nnrp1.deja.com> <3A3445A8.8FC404D5@acm.org> <912ut9$fga$1@nnrp1.deja.com> <3A35AFFF.CA2BA2F9@acm.org> <916gfk$e07$1@nnrp1.deja.com> <916n66$j8c$1@nnrp1.deja.com> <3A376D69.A420D711@earthlink.net> <131220001555268634%emery@mitre.org> <1elo8l3.coy4nxb5upaqN%claveman@inetworld.net> NNTP-Posting-Host: locnar.visicom.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 [en] (X11; U; HP-UX B.10.20 9000/755) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:3181 Date: 2000-12-15T12:43:30-08:00 List-Id: "Charles H. Sampson" wrote: > > David Emery wrote: > > Actually, I find this an acceptable compromise between my preferred > style of using the use clause and the usual style of requiring fully > qualified names. For me, qualifying everything with package names in- > troduces a tremendous amount of clutter, particularly if the package > names are long, for the occasional payoff when looking up the name is > necessary. Using the two- or three-letter rename at least reduces that > clutter to manageable proportions. If the abbreviations have some dis- > tinguishing characteristic, such as being all upper case, then your eye > can skip across them quite easily. Standard, project-wide, renames are > helpful too, but that might not be practical in monstrous projects that > have hundreds of packages. > > I don't understand the point of the rename in the package specifi- > cation. > > Charlie > > -- > To get my correct email address, replace the "claveman" by > "csampson" in my fake (anti-spam) address. What we do at our company is make renames for each operator that we need to import. e.g. (pulled randomly from our code): function "*"(L:Measurements.Distance_Type; R:Measurements.Distance_Type) return Measurements.Distance_Type renames Measurements."*"; That way we can use the "*" inline without the messy syntax. For instance, we can write: A := B * C; instead of: A := Measurements."*"(A, B); For complex statements, the renames really help. As far as the TLAs (three letter acronyms), we used to do that all over our code. Things got so bad though that we had to use acronyms that didn't even match what we were trying to rename because it was already taken by another renamed package. What would be nifty would be to allow a package spec define its own "approved" renames of the package that other packages would be allowed to use. I'm sure I'll hear immediately why it's not a good idea though ;-) -- Wayne.