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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,86fd56abf3579c34 X-Google-Attributes: gid103376,public From: cons116@twain.oit.umass.edu (Mike White) Subject: Re: State machines and Goto's (was Re: Should internet support software be written in Ada?) Date: 1995/04/01 Message-ID: <3line1$ma0@nic.umass.edu>#1/1 X-Deja-AN: 100649476 distribution: world references: <3kaksj$iur@isnews.calpoly.edu> <3ki9t8$c8l@Starbase.NeoSoft.COM> <3ldnmh$hi5@maple.enet.net> organization: University of Massachusetts, Amherst newsgroups: comp.lang.ada Date: 1995-04-01T00:00:00+00:00 List-Id: DanKurfis wrote: : In article , : eachus@spectre.mitre.org says... [deleted] : >of course, no reason to include them in a language.) So AFAIK, the : >only legitimate use of gotos are in state machines. [more snipped] : (basically) simple tasks containing one main loop enveloping a (huge) case : construct. I've always believed this to be the best mechanism to implement : these particular state machines, but I'm always open to new ideas. I'd agree. The argument might be made that using a case construct results in slower code, but in fact, a case would only be a comparison and a jump slower than a goto once compiled. The resulting code, however, is more structured and maintainable, IMO. -- *************************************************************************** * Michael White * "Man is a biped without feathers." * * cons116@titan.ucs.umass.edu * -Plato * ***************************************************************************