Xref: utzoo misc.misc:5924 comp.misc:5940 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!garnet.berkeley.edu!ked From: ked@garnet.berkeley.edu (Earl H. Kinmonth) Newsgroups: misc.misc,comp.misc Subject: Re: The "evil" GOTO (Was: 25 Years of BASIC) Message-ID: <24044@agate.BERKELEY.EDU> Date: 5 May 89 02:47:13 GMT References: <1791@ubu.warwick.UUCP> <1436@onion.reading.ac.uk> <1814@ubu.warwick.UUCP> Sender: usenet@agate.BERKELEY.EDU Organization: University of California, Berkeley Lines: 42 Keywords: Guinness, phlegm, mackerel, intestines >magic wand over a language by excising GOTO, and everything will be >alright. Listen, just 'cause Quiche-eater Wirth connected GOTOs with >lack of structure geenrally, 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 I began programming in 1968 on a CDC 1604. I used Fortran (when the sucker did not force me to use binary). Thus, I am more than familiar with the go to statement (including the conditional go to statement). Since 1979 I have been programming in C. I have written C code into the high six-figures (lines of code). There has not been one case where a goto seemed appropriate. When I was tempted, reflection and analysis convinced me that a goto solution was inappropriate. This is not a quiche-eater's problem. I teach Japanese history by profession, and could give a s__t one way or the other. I want code that is efficient (where efficiency includes my time) and that I have some hope of understanding a few months or years down the line. By my standards, the goto s__ks. Some months ago, I rewrote GNUtar (an early version) to run under MSDOS. The original author, in the name of "efficiency" had used a large number of goto(s). As is common with such programming, he had not used prof to find out whether the goto really resulted in faster execution. He had, however, succeeded in making the code extremely difficult to read. As for the example that was part of this original posting, the author should learn to use the switch statement. The switch in C is in effect a "conditonal goto" (to use the jargon I learned with the 1604 in 1968), but it is much, much easier to read. Since my specialty is Japanese history (albeit built on an undergrad education in EE), I probably should not be telling !!!!!PROGRAMMERS!!!!! (bells, gongs, drum rolls, trumpet flourishes) how to do their work. Based on substantial experience, I would nevertheless suggest that if you are absolutely convinced of the need for a goto, that section of the code should really be done in assembler.