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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f24b55bcdf15c088 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-07 00:01:30 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!newsfeed.icl.net!news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!newsfeed1.telenordia.se!algonet!uab.ericsson.se!erinews.ericsson.se!news.emw.ericsson.se!not-for-mail Message-ID: <3AA5E92D.8446E7AB@emw.ericsson.se> From: Sven Nilsson Reply-To: sven.nilsson@emw.ericsson.se Organization: Ericsson Microwave Systems AB X-Mailer: Mozilla 4.75C-EMW [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada95 tutorials with sample code. References: <3AA44F83.87CB23B7@acm.org> <3AA48DE9.A0650F21@emw.ericsson.se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 07 Mar 2001 08:54:21 +0100 NNTP-Posting-Host: 136.225.182.69 X-Trace: news.emw.ericsson.se 983951661 136.225.182.69 (Wed, 07 Mar 2001 08:54:21 MET) NNTP-Posting-Date: Wed, 07 Mar 2001 08:54:21 MET Xref: supernews.google.com comp.lang.ada:5493 Date: 2001-03-07T08:54:21+01:00 List-Id: 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