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-19 08:37:23 PST Path: supernews.google.com!sn-xit-02!supernews.com!router1.news.adelphia.net!logbridge.uoregon.edu!netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Marin David Condic Newsgroups: comp.lang.ada Subject: Re: Bad coding standards Date: Tue, 19 Dec 2000 11:36:25 -0500 Organization: Quadrus Corporation Message-ID: <3A3F8E88.317C9FDB@acm.org> References: <91b9ma$bne$1@nnrp1.deja.com> <3A3E36C4.3466A19C@averstar.com> <3A3E5E7E.67817482@acm.org> <91o028$vp2$1@nnrp1.deja.com> NNTP-Posting-Host: d1.56.b1.b6 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 19 Dec 2000 16:34:41 GMT X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:3258 Date: 2000-12-19T16:34:41+00:00 List-Id: Robert Dewar wrote: > Yes, that is of course true, nevertheless it is an advantage > if everyone, or at least most folks, agree on a consistent > style, as it makes discussion easier (it has for example > been a consistent annoyance in C that there are several > conventions for the use of {} > Oh sure. If there was a well defined and accepted standard for Ada programming in general, it is better for people to stick with that than go off inventing something of their own for every given project. I recall looking at the Software Productivity Consortium's efforts in this area and adopted many of the style guides in my efforts. However, my comment to my boss at that time was: "Nice standard. I'd really hate to get audited against it though." That pretty much burried it for our projects. Just way too much detail for being enforceable. I circulated it with other developers and strongly recommended that they look it over and try to utilize it. I just didn't want an internal or external auditor to start going through reams of our code and ding us at every violation. That can get very costly and all you're doing is dealing with cosmetic things that don't impact The Bottom Line as much as a slipped delivery date would. IMHO, if you have a style guide that can be written in - say - oh... ten pages or less? - then you probably have something that can reasonably be utilized and enforced on a project. The SPC's style guide was well over this page limit. > > The fact that indentation is strongly suggested by the RM > has meant that pretty much everyone uses the same indentation > style, which is an advantage. > Definitely. Syntactically, Ada tends to indent better than C/C++ - especially when you look at the kinds of "tricks" that your garden variety C programmer likes to pull. (Doing all the work of a loop in the iteration scheme, for example) The standard sets an example which generally tends to get followed. But I've seen programs where indentation may vary from 2..3..4 spaces. No clear agreement about how many are required. Does it matter? Maybe a little. Are other ARM conventions important - such as character case or where to break long statements or parameter lists, etc? I think that most Ada code I've seen tends to at least be reminicent of the ARM, but some of the code examples there are not to my liking and I wouldn't blame developers for establishing different ones. We may never get full agreement on what style looks best, so I'd still go with at least having a consistent standard on a project by project basis. And the standard should not be long or rigid or it simply won't get followed. (Remember "The Mandate"... :-) MDC -- ====================================================================== Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Giving money and power to Government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke ======================================================================