Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.lang.c Subject: Re: gotos Summary: confession Message-ID: <2565@ttrdc.UUCP> Date: 10 Apr 88 03:50:48 GMT References: <2571@cognos.UUCP> <77200029@uiucdcsp> <4307@ihlpf.ATT.COM> <5170@ihlpg.ATT.COM> Organization: AT&T, Skokie, IL Lines: 77 In article <5170@ihlpg.ATT.COM>, tainter@ihlpg.ATT.COM (Tainter) writes: # In article <4347@ihlpf.ATT.COM>, nevin1@ihlpf.ATT.COM (00704a-Liber) writes: # > In article <2556@ttrdc.UUCP> levy@ttrdc.UUCP (Daniel R. Levy) writes: # > |I know this battle is an old chestnut, but for the record do you guys believe # > |that superfluous flags and great big if-then statements are truly superior # > |to the goto? (And the break, which is a goto by another name.) E.g.: # > | while (loopcond) { # > | for (i=0; i | if (frob(i) == TRUE) # > | goto loopagain; /* nice and CLEAN!!! */ # > | .../* lots and lots of code over many pages */... # > |loopagain: ; # > | } # > Opinion: this is an example of FORTRAN disguised as C. # > In this particular case, using a continue statement # > inside in your Fortran-type example instead of a goto is much more preferable. # # Except of course that that wouldn't work since it is nested under a second loop. # This is the only alternative to using a flag on the lines of the alternative # code. # [ Flag riddled code at indentation >> removed ] # > Opinion: this is an example of Pascal disguised as C. # > _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 # People, listen closely, GOTOs are not inherently bad. If used carefully # as in this example they are quite reasonable and really not hard to follow. # Of course, they would be much harder to understand if they didn't use # mnemonics and instead used numbers ala Pascal or ForTran. # --j.a.tainter Somebody mailed me a much better form of what I was trying to do: while (loopcond) { for (i=0; i}!ttrdc!ttrda!levy | AT&T Data Systems Group | Disclaimer? Huh? What disclaimer??? |--------Skokie, Illinois--------|