Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!ll-xn!ames!amdcad!rpw3 From: rpw3@amdcad.AMD.COM (Rob Warnock) Newsgroups: comp.lang.c Subject: Re: goto's Message-ID: <17753@amdcad.AMD.COM> Date: Wed, 29-Jul-87 21:27:28 EDT Article-I.D.: amdcad.17753 Posted: Wed Jul 29 21:27:28 1987 Date-Received: Sat, 1-Aug-87 01:41:42 EDT References: <3289@bigburd.PRC.Unisys.COM> <7571@beta.UUCP> Reply-To: rpw3@amdcad.UUCP (Rob Warnock) Organization: [Consultant] San Mateo, CA Lines: 37 In article <1217@bloom-beacon.MIT.EDU> tdavis@ATHENA.MIT.EDU (Timothy L. Davis) writes: +--------------- | 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. | 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 +--------------- This is *precisely* what led Bill Wulf (over a decade ago) to publish ago a short note in ACM SIGPLAN(?) entitled "Global Variable Considered Harmful" (following Dijkstra's earlier paper "Goto Considered Harmful"). It is not the "goto" per se which is harmful, but the spagetti control flow which results from an undisciplined use of it, and the resulting human difficulty in proving that all possible combinations of that control flow yield the correct results. (Also see Miller's classic "The Magical Number Seven Plus Or Minus Two".) Remember, Dijkstra's definition of "structured programming" was *not* a simplistic "no gotos", but rather an unceasing vigilence against all manner of "complexity generators". Global variables (*all* global variables) create the same potential for unbridled complexity. On the other hand, while "no gotos" and "no global variables" are very useful heuristics, following them doesn't guarantee success. Murphy's Something-Or-Otherth Law: "It ain't that simple." Rob Warnock Systems Architecture Consultant UUCP: {amdcad,fortune,sun,attmail}!redwood!rpw3 ATTmail: !rpw3 DDD: (415)572-2607 USPS: 627 26th Ave, San Mateo, CA 94403