From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99222a5bd46ef3c9 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: GOTO considered necessary (reworked) Date: 1997/06/17 Message-ID: #1/1 X-Deja-AN: 249144054 References: <5nn2fm$11dk$1@prime.imagin.net> <33A6A9C4.7B87@no.such.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-06-17T00:00:00+00:00 List-Id: Wes says <> Another form of this I find annoying is "a return is basically a goto, so don't use returns" (for example SPARK forbids the use of gotos in procedures). I personally find returns very handy, even though I know perfectly well they are gotos: procedure ... is begin if condition then do something simple return; else LOTS MORE CODE it is very handy to read the procedure and immediately know that you have the whole story if condition is true, without having to see if there is some code following the end if. I occasionally use gotos in a similar way, almost like an exception (and some fanatics would insist on turning them into exceptions) -- you are buried deep in complex logic, and you want to say "get out, abandon all this stuff, this is not what we are looking for, go and do something else" occasionally a goto conveys this intention as clearly as anything :-) dp (a little quiz, why do my messages occasionally end with ^Zdp? I know the answer, I am just wondering if it is obvious :-) :-)