Xref: utzoo misc.misc:5954 comp.misc:5956 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cetron From: cetron@wasatch.utah.edu (Edward J Cetron) Newsgroups: misc.misc,comp.misc Subject: Re: The "evil" GOTO (Was: 25 Years of BASIC) Message-ID: <1745@wasatch.utah.edu> Date: 5 May 89 20:58:26 GMT References: <1791@ubu.warwick.UUCP> <1436@onion.reading.ac.uk> <1814@ubu.warwick.UUCP> <24044@agate.BERKELEY.EDU> <2861@cps3xx.UUCP> Organization: Morrison-Knudsen, Industrial Buildings Division, SLC, UT Lines: 53 >from the middle of a function fred() is "more evil" (IMHO) than making >a label "end_of_fred" and using "goto end_of_fred". Why? Because >there is only one entry to and exit from the function (as somebody >else pointed out, this is useful if you're allocating resources etc.) good point > Incidentally, using GOTO in these ways--always to get out of a >structure--doesn't seriously hurt compiler optimization, because you >shouldn't be breaking up basic blocks in the process (jumping into the >middle of a sequence of statements is what's evil, GOTO's not evil). > another good point > > Assembler??? Why should I sacrifice readability, and (some) >portability, just because I need (or want) a "goto"? > >| Anton Rang (grad student) | "VMS Forever!" | VOTE on | This entire GOTO debate seems to be indicative of the quality of programmers currently available today. To them, STRUCTURE is EVERYTHING. They've even forgotten (or never learned WHY structured concepts are good). But MOST IMPORTANTLY the forget that somewhere, somehow, a computer HAS to execute these programs. Before I ever was taught about programming, I was taught how the computers worked at the machine code level. If once only considers the computer at the HLL level, no matter how good and optimizing compiler you have, you can still write stuff that is damned inefficient. Maybe all these anti-GOTOites only write big COBOL programs which are only used for Public Utility billing activities :-). No matter what your code is like in a HLL, it is STILL just a GOTO (JMP, BR, RTS...) to the CPU. We've bred an entire generation of programmers and CS students who are so concerned with 'ADA is better than C, and FORTRAN sucks' and 'STRUCTURE is all that matters' and 'UNIX is it' that they have forgotten why programs are written in the first place. They sit in their " programmers' ivory tower" and forget that the program is supposed to do something in reality! I would rather have a clearly written program (structured or not) which accomplishes what the PROGRAM is intended to do, without excess baggage and }'s JUST to satisfy some STRUCTURED PROGRAMMING GOD, with GOTO's when necessary, AND WHICH SHOW SOME UNDERSTANDING OF THE COMPUTER UNDER WHICH IT WILL RUN, than some beautiful piece of code which when compiled/linked is nothing but dribble to the CPU anyway. Maybe that's why I only hire hardware oriented people. You can teach a h/w person to program, but most s/w types are confused by hardware. I'm not saying I prefer to code in assembler, but that one MUST know one's environment. It does not good to write exquisite Latin prose if your audience speaks Chinese. Sorry for the flame, I'm just tired of interviewing smug new CS students who know nothing about reality and using the right tools for the job. They make great followers, but we desparately need thinkers and leaders. -ed cetron cetron@wasatch.utah.edu