Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!pt!ius2.cs.cmu.edu!edw From: edw@ius2.cs.cmu.edu (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: goto's in C: an opinion... Message-ID: <1237@ius2.cs.cmu.edu> Date: Fri, 17-Jul-87 16:55:02 EDT Article-I.D.: ius2.1237 Posted: Fri Jul 17 16:55:02 1987 Date-Received: Sat, 18-Jul-87 16:52:17 EDT References: <3289@bigburd.PRC.Unisys.COM> <7571@beta.UUCP> Organization: Carnegie-Mellon University, CS/RI Lines: 27 Keywords: C, goto, style Summary: I hate absolutes In an article by Skip Egdorf (hwe@beta.UUCP), Skip sez, > There are NO legitimate uses for the goto statement... I sez.. There is a whole class of problems that map very nicely into goto contructs. They are simulation of NFAs and DFAs (ie finite state machines). States map very nicely to labels and transitions map very nicely into if (input == ?) goto label. The most readable way one can represent the NFA/DFA is through a mesh of gotos with a diagram of the machine in comments :-). For most other problems though, gotos are not need. I have to admit though, since my days of BASIC, I haven't used a single goto statement. The lexigraphical analysizers I've written, have been simple enough that one case statement with some nicely place returns will do the job. -- Eddie Wyatt e-mail: edw@ius2.cs.cmu.edu terrorist, cryptography, DES, drugs, cipher, secret, decode, NSA, CIA, NRO.