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.1 required=5.0 tests=BAYES_00,INVALID_MSGID, UNRESOLVED_TEMPLATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4e061ad664a897c4,start X-Google-Attributes: gid103376,public From: CONDIC@PSAVAX.PWFL.COM Subject: Re: State machines and Goto's (was Re: Should internet support so Date: 1995/04/07 Message-ID: #1/1 X-Deja-AN: 100070379 sender: Ada programming language comments: Gated by NETNEWS@AUVM.AMERICAN.EDU newsgroups: comp.lang.ada Date: 1995-04-07T00:00:00+00:00 List-Id: From: Marin David Condic, 407.796.8997, M/S 731-93 Subject: Re: State machines and Goto's (was Re: Should internet support softwar Original_To: PROFS%"SMTP@PWAGPDB" Original_cc: CONDIC Theodore Dennison Writes: > >I have now worked under 3 different Ada coding standards. Every one >of them had a "no goto's" rule. Since I'm currently editing our next >coding standard, perhaps someone could suggest a replacement rule? It >should be very specific about what allowable and unallowable goto's >are. We need something that our software quality folks can enforce. >The rule can make NO assumptions about the competency of the programmer, >as we won't find out the truth on that matter until it is too late. > I'll throw in my $0.02. I've been programming in Ada for what is beginning to seem like a very long time now and done a variety of systems in a number of problem spaces. (realtime, business, database, mathematical, navigational, etc.) I have NEVER ONCE needed a goto to implement the design of any of these systems or seen an example of where the use of a goto as opposed to structured techniques would result in a "cleaner design". There may be systems or problem spaces where the goto _would_ result in cleaner design. There may be gold bricks in the Great Wall of China. There may even be sheep that fly (with all the enormouse commercial possibilities that implies). I just have never seen any of these phenomena. If you think you need to use a goto instead of a case/if/while/etc. then you probably haven't thought about it long enough. I'd suggest that your coding standard ought to disallow goto's. Granted - they can be used properly and not produce spaghetti code, but they are too easily abused. (When DEC invented BLISS, they didn't even include a goto in the language) I'd also suggest that you put a clause up at the very beginning of your coding standard (in VERY BOLD TYPE!!!) that _any_ of the rules laid down in the standard may be violated provided that the software engineer responsible documents it and provides a justification. We've done that for years and had very few instances where the coding standard was circumvented. When it's been done, there's usually a good engineering reason for doing so and you can find it out by reading the comments. Pax Vobiscum, Marin Marin David Condic, Senior Computer Engineer ATT: 407.796.8997 M/S 731-93 Technet: 796.8997 Pratt & Whitney, GESP Internet: CONDICMA@PWFL.COM P.O. Box 109600 Internet: MDCONDIC@AOL.COM West Palm Beach, FL 33410-9600 =============================================================================== Please send responses to one of the addresses in this trailer. A "reply" to the address in the message header will bounce. =============================================================================== "Get this straight once and for all. The policeman isn't there to create disorder; he's there to preserve disorder." -- Richard J. Daley, former mayor of Chicago. ===============================================================================