Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!bloom-beacon!tdavis From: tdavis@athena.mit.edu (Timothy L. Davis) Newsgroups: comp.lang.c Subject: Re: goto's Message-ID: <1217@bloom-beacon.MIT.EDU> Date: Wed, 29-Jul-87 02:53:25 EDT Article-I.D.: bloom-be.1217 Posted: Wed Jul 29 02:53:25 1987 Date-Received: Fri, 31-Jul-87 01:35:57 EDT References: <3289@bigburd.PRC.Unisys.COM> <7571@beta.UUCP> <765@haddock.ISC.COM> <7687@mimsy.UUCP> <465@bms-at.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: tdavis@ATHENA.MIT.EDU (Timothy L. Davis) Organization: Massachusetts Institute of Technology Lines: 22 In article <465@bms-at.UUCP> stuart@bms-at.UUCP (Stuart D. Gathman) writes: > >Knuth has an excellent method for converting any program, no matter how >convoluted, to perfectly structured code with no goto's. >... > IF P = 1 THEN > (* DO STEP 1 *) > P := (* STEP TO PERFORM AFTER 1 *) > IF P = 2 THEN > (* DO STEP 2 *) > P := (* STEP TO PERFORM AFTER 2 *) >... I am just finishing a modification of a program which used this precise system for "computed" gotos. What a mess! It was nearly impossible to read clearly. The little assignment statements, which were in effect gotos, were MUCH harder to follow than goto's themselves. If you are going to write spaghetti code, you might as well use the spaghetti construct! Tim Davis tdavis@ATHENA.MIT.EDU ...mit-eddie!mit-athena!tdavis