Xref: utzoo misc.misc:6419 comp.misc:6242 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!warwick!mirk From: mirk@warwick.UUCP (Mike Taylor) Newsgroups: misc.misc,comp.misc Subject: Re: The "evil" GOTO (Was: 25 Years of BASIC) Summary: ADA is as ADA does (a bit) Keywords: Guinness, phlegm, mackerel, intestines Message-ID: <1956@ubu.warwick.UUCP> Date: 1 Jun 89 22:14:24 GMT References: <1814@ubu.warwick.UUCP> <136@cerc.wvu.wvnet.edu.edu> Sender: news@warwick.UUCP Reply-To: mirk@uk.ac.warwick.cs (Mike Taylor) Organization: Computer Science, Warwick University, UK Lines: 50 In article kannan@babcock.cerc.wvu.wvnet.edu (R. Kannan) writes: > I agree 100% that GOTO has been subject to very unfair criticism. > The example you have given, does good. But your comparison with Ada > exception handling feature really is completely out of line. Can you > clarify further, why Ada exception handling should be considered just > as another glorified GOTO package. Well, you've got to stand back from the glorious DoD fanfare, (or is it MoD?), and look at what the language really has to offer. Like IBM's PC, once you take away the badge, nothing much. It's the only language I know that has only ONE control-structure; unconditional GOTO. I mean, OK, dress it up a bit, represent it by a right-pointing arrow, whatever, but at the end of the day, they're not fooling anyone, and I know GOTO when I see it! Oh dear, I'm terribly sorry, I've just realised I'm talking about APL, not ADA :-) :-) :-) Seriously though, ask yourself, what IS exception handling? It's just saying, "When event E occurs, go to code section C, whatever else you're doing". S'a lot like catching signals in C. All that frogging about with setjmp() and longjmp() gets represented as something clever, something for "real programmers", and most people seem to swallow the idea without flinching, and more importantly, _without_ _THINKING!_ This is what I really object to, I guess. I mean, C is much more my field that ADA, so don't get the impression that I really know what I'm talking about (1/2 :-), but certainly I have come across the sort of attitude a lot of the while that says that once you dress GOTO up a bit, call it something different, (longjmp() in this case), everything is OK. I hope that everyone reading this knows deep down inside that it is just as possible to abuse "while", "for", "do", "longjmp()" or whatever other control structure you use, as it is to abuse GOTO. It is _easier_ to abuse GOTO, partly because many of us learned our programming on machines where that was all we had. But at the end of the day, control structures are supposed to be tools, and if we're irrationally afraid of one of them, then it's not gonna help us. "All [control structures] are permissible to me -- But I will not allow myself to be mastered by any!" -- Apostle Paul, 1 Corinthians On an only vaguely related note -- the one thing that annoys me about C is that you can't do n-level breaks. If Bourne shell (:-P) can manage it, I'da hoped C could! ______________________________________________________________________________ Mike Taylor - {Christ,M{athemat,us}ic}ian ... Email to: mirk@uk.ac.warwick.cs "istrcmp() -- Naughty but nice! ... Why isn't my program working?" - Sunny