Xref: utzoo misc.misc:6012 comp.misc:5999 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!uflorida!novavax!twwells!bill From: bill@twwells.uucp (T. William Wells) Newsgroups: misc.misc,comp.misc Subject: Re: The "evil" GOTO (Was: 25 Years of BASIC) Message-ID: <909@twwells.uucp> Date: 6 May 89 21:01:13 GMT References: <1814@ubu.warwick.UUCP> <13113@lanl.gov> <2854@cps3xx.UUCP> Reply-To: bill@twwells.UUCP (T. William Wells) Followup-To: alt.flame Organization: None, Ft. Lauderdale Lines: 47 Summary: Expires: Sender: Distribution: Keywords: In article <2854@cps3xx.UUCP> rang@cpswh.cps.msu.edu (Anton Rang) writes: : In article <13113@lanl.gov> jlg@lanl.gov (Jim Giles) writes: : > printf ("Enter your sex: "); : > for (;;) { : > gets (sex); : > if (sex == "m" || sex == "f") break; : > printf (" or only: "); : > } : This is ugly; it essentially transforms the code : : LABEL: get input : if (bad input) : print message : go back to label : : into : : LABEL: get input : if (good input) : goto LABEL2 : print message : go back to label : LABEL2: Silly boy! No one gives a f*** how the code gets transformed. All we have to read is the original. And the original is simplicity itself. Would you please return to your ideological teachers and not bother us with such irrelevancies? : Now you have two places where control jumps around, instead of just : one. 'break' has its uses, perhaps, but this isn't one of them : (IMHO). Actually, I feel that 'break' should usually be replaced by : an explicit goto (heresy!). Why? Because the place the break goes to : isn't explicit; you have to start matching up loops. If you have lots : of nesting, this is quite a mess. By this you demonstrate that you have nothing worthwhile to say on the subject. You just don't understand the problem. Hell, you are *part* of the problem. Followups have been directed to alt.flame. --- Bill { uunet | novavax } !twwells!bill