Xref: utzoo misc.misc:6165 comp.misc:6107 Path: utzoo!attcan!ncrcan!ziebmef!stephen From: stephen@ziebmef.uucp (Stephen M. Dunn) Newsgroups: misc.misc,comp.misc Subject: Re: The "evil" GOTO (Was: 25 Years of BASIC) Summary: agreement and disagreement in one article Message-ID: <1989May13.201706.12649@ziebmef.uucp> Date: 14 May 89 00:17:05 GMT References: <1791@ubu.warwick.UUCP> <1436@onion.reading.ac.uk> <1814@ubu.warwick.UUCP> <2848@cps3xx.UUCP> Reply-To: stephen@ziebmef.UUCP (Stephen M. Dunn) Organization: Ziebmef Public Access Unix, Toronto, Ontario Lines: 34 In article <2848@cps3xx.UUCP> rang@cpswh.cps.msu.edu (Anton Rang) writes: $In article <1814@ubu.warwick.UUCP> mirk@warwick.UUCP (Mike Taylor) writes: $ [ ... ] Listen, just 'cause Quiche-eater Wirth connected GOTOs with $ ^^^^^ $ lack of structure generally, doesn't mean either that (A) ALL use of $ GOTO is unstructured and obfuscatory, or that (B) ALL obfuscated code $ is due to use of GOTO -- so why is it that so many people seem to $ believe these myths? $It was Dijsktra [sp?]. Other than that, I perfectly agree! Dijkstra ... close but no carcinogenic cylinder. The statement above is quite correct IMHO. However, in a language like many dialects of BASIC which have no control structures other than FOR-NEXT, GOTO and GOSUB, it _can_ be next to impossible to write anything other than obfuscated spaghetti code. Note that this does not contradict either of the above points. Also, it is possible to write some very lousy code in languages which do not provide a GOTO (or, in those that do, by avoiding it), especially if they provide no means for prematurely terminating or repeating a loop other than a huge IF statement. And, of course, we all know it's possible to write very cryptic code in C, but that doesn't mean that C should be abolished (it just means that programmers should be taught not to write such code). Still, IMHO (for the second time) the use of GOTOs should be minimized whenever possible, since it generally does lead to harder-to- read programs which are unmaintainable by anyone other than the programmer (and often not even maintainable by him/her more than a couple of weeks later)! -- ------------------------------------------------------------------------------- ! Stephen M. Dunn stephen@ziebmef.UUCP ! DISCLAIMER: Who'd ever ! ! Take off to the Great White North eh, ya hosehead ! claim such dumb ideas? ! -------------------------------------------------------------------------------