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: bobduff@world.std.com (Robert A Duff) Subject: Re: GOTO considered necessary (reworked) Date: 1997/06/13 Message-ID: #1/1 X-Deja-AN: 248248132 References: <5nn2fm$11dk$1@prime.imagin.net> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-06-13T00:00:00+00:00 List-Id: In article <5nn2fm$11dk$1@prime.imagin.net>, Samuel Mize wrote: >I'm rebeating a dead horse, in order to write up a consensus paper to >submit to adahome. I'll appreciate your input. I don't quite understand what the point of this is. I mean, it's fun to argue about goto statements, but there's no real problem here. There's not a lot of Ada code out there filled with rats nests of gotos, so what's the point of admonishing people about it? The range of opinions on this point goes from "it's never appropriate to use goto" to "it's hardly ever appropriate to use goto" -- not a very wide range. I don't hear anybody saying "avoid if/case/loop, and always use goto whenever possible". And new Ada programmers these days are naturally happy to use if/case/loop most of the time (unless their mind has been polluted by spending too much time writing code in a language that doesn't *have* if/case/loop). As you say: >f) The shared Ada culture avoids "goto" statements. Gellerich et al examined > 34428 files containing 8.5 million lines of code, coded by many projects, > institutions, and programmers. They found a "goto" density of 1 "goto" per > 13614 lines of code. ... If there aren't many goto's in real Ada code, then clearly there aren't many cases of misuse of goto. Note that the above statistic doesn't mean Ada programmers think goto is evil. I mean, if you count the number of delay statements, you'd come up with a similar low density -- even a tasking program will typically have far more if statements, assignment statements, etc than delay statements. The above statistic just means that people don't think goto is appropriate very often -- just like delay isn't appropriate very often. Like I said, I think it's fun to argue about gotos, and if I have time maybe I'll reply to your technical points (most of which I agree with, by the way). But I don't think your goto FAQ is addressing any practical problem in the world. - Bob