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-13 05:38:29 PST Path: supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!howland.erols.net!cyclone2.usenetserver.com!news-out.usenetserver.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3A376D69.A420D711@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: Bad coding standards References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 13 Dec 2000 13:38:29 GMT NNTP-Posting-Host: 63.178.180.82 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 976714709 63.178.180.82 (Wed, 13 Dec 2000 05:38:29 PST) NNTP-Posting-Date: Wed, 13 Dec 2000 05:38:29 PST Xref: supernews.google.com comp.lang.ada:3054 Date: 2000-12-13T13:38:29+00:00 List-Id: (was Re: constant string array) Ken Garlington wrote: > I say, why stop at one set? I think a nice rule would be to encode tests in > double parentheses, similar to label constructs, i.e. > > if ((a * b + c)) then > ... > end if; > > so that, if you're doing structural test coverage analysis, you can find the > essential elements easily. Wouldn't that just be a lovely standard? I tried really, really hard to not start talking about bad coding standards I've encountered, but I just can't stop myself! :-) Here's my top 3, in no particular order, thankfully each of which occurred on a _different_ program: - The first letter of each source line was to be capitalized, and _all_ other words, reserved and user-defined, were to be lower-case. One exception was permitted--for the "end xxx" construct, where "xxx" was "if" or "case" or the unit name, etc., "end" was also to be lower-case. (The rationale for this practice was that it would "make the text more readable", since it conformed to the capitalization practice of English language sentences. I went round and round with the author for years on this one; he finally retired and I rewrote the standard.) - No subtypes. If there is a situation where a new type that is related to an existing type would be useful, _derive_ the new type and use explicit conversion when values of types in the derivation tree have to interact, do not use subtypes. (This, I believe, was a result of some rabid "type zealotry" that felt that subtypes allowed sloppiness and a way of working around strong typing. Fortunately this program was being relocated and had lost most of its developers when I joined up, so we were able to ignore this standard until I had a chance to rewrite it.) - No child packages. No "aliased" objects. Basically, no Ada 95 language features, except for the new packages like the Strings and Interfaces ones. (This standard actually was more verbal than documented, and was caused by the project being ported to Ada 95--and a new compiler. The personnel had had no exposure to Ada 95, so it was simply decided to forbid the use of the new features. I was able to bring in a lot of experience with the features, and so with some guidance the developers were permitted to start exercising Ada 95's capabilities.) Marc A. Criley Senior Staff Engineer Quadrus Corporation www.quadruscorp.com