comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: GOTO considered necessary (reworked)
Date: 1997/06/13
Date: 1997-06-13T00:00:00+00:00	[thread overview]
Message-ID: <EBpyzK.5pH@world.std.com> (raw)
In-Reply-To: 33A0840B.1B41@sprintmail.com


In article <33A0840B.1B41@sprintmail.com>,
John G. Volan <johnvolan@sprintmail.com> wrote:
>I agree with that philosophy, but I'd clarify it: Gotos may be used only
>as a _last_ resort, after every other possible structure has been
>exhaustively tried and still found to be less understandable, or
>maintainable, or efficient, or whatever, than the proposed goto
>solution. ...

This seems like a strange attitude to me.  I mean, why not say the same
thing about any other language feature, like if statements?  You
shouldn't use an if statement if there is another way of writing the
code that's more understandable, maintainable, or whatever.  The same
applies to goto.  Why does that make goto a "last resort"?

I certainly agree that there are lots more cases where if statements are
appropriate than cases where goto is appropriate.  But both can be
judged according to the same criteria -- as you said, "understandable,
or maintainable, or efficient, or whatever".

I would also agree, if you said, "As a rule of thumb, if you think you
want to use a goto, think twice."

>...  But this is a very stringent requirement, and I expect it
>will be very rare that a goto solution will beat out all other
>alternatives.

And everybody seems to agree with *that*.

By the way, for most programs, it seems far more important to worry
about how you structure the thing using packages, types, subprograms,
tasks, etc, than to worry about the control structures.  Usually the
control structures are so small (within a single subprogram), that even
if you *only* used goto for control flow (which I don't recommend, of
course!) you could still understand the program.

- Bob




  reply	other threads:[~1997-06-13  0:00 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-11  0:00 GOTO considered necessary (reworked) Samuel Mize
1997-06-11  0:00 ` Bryce Bardin
1997-06-12  0:00 ` Anonymous
1997-06-12  0:00   ` Robert Dewar
1997-06-12  0:00     ` John G. Volan
1997-06-13  0:00       ` Robert A Duff [this message]
1997-06-16  0:00         ` John G. Volan
1997-06-17  0:00           ` Robert A Duff
1997-06-25  0:00             ` Van Snyder
1997-06-17  0:00           ` Robert I. Eachus
1997-06-17  0:00           ` Robert Dewar
1997-06-17  0:00             ` Robert A Duff
1997-06-18  0:00               ` Spam Hater
1997-06-20  0:00               ` Robert Dewar
1997-06-20  0:00               ` Robert Dewar
1997-06-21  0:00                 ` Robert A Duff
1997-06-21  0:00                   ` Robert Dewar
1997-06-25  0:00               ` Wolfgang Gellerich
1997-06-25  0:00                 ` Samuel T. Harris
1997-06-25  0:00                 ` Michael F Brenner
1997-06-26  0:00                   ` Wolfgang Gellerich
1997-06-19  0:00             ` Karel Th�nissen
1997-06-19  0:00               ` Karel Th�nissen
1997-06-23  0:00               ` John G. Volan
1997-06-23  0:00                 ` Robert Dewar
1997-06-24  0:00                   ` Brian Rogoff
1997-06-25  0:00                   ` Featuritis not always bad (was re: GOTO considered necessary) Karel Th�nissen
1997-06-26  0:00                     ` Robert Dewar
1997-06-26  0:00                       ` Karel Th�nissen
1997-06-23  0:00                 ` GOTO considered necessary (reworked) Spam Hater
1997-06-25  0:00                 ` Karel Th�nissen
1997-06-23  0:00             ` John G. Volan
1997-07-21  0:00           ` Shmuel (Seymour J.) Metz
1997-06-12  0:00   ` John G. Volan
1997-06-16  0:00     ` Anonymous
1997-06-12  0:00 ` Michael F Brenner
1997-06-17  0:00   ` Robert Dewar
1997-06-17  0:00     ` Robert A Duff
1997-06-20  0:00       ` Robert Dewar
1997-06-21  0:00         ` Robert A Duff
1997-06-21  0:00           ` Robert Dewar
1997-06-13  0:00 ` Robert A Duff
1997-06-14  0:00   ` Robert Dewar
1997-06-16  0:00     ` Robert A Duff
1997-06-17  0:00       ` Spam Hater
1997-06-17  0:00         ` Robert Dewar
1997-06-17  0:00           ` Spam Hater
1997-06-17  0:00           ` Robert A Duff
1997-06-19  0:00             ` John Herro
1997-06-25  0:00               ` Function result Van Snyder
1997-06-27  0:00                 ` Robert Dewar
1997-06-27  0:00                 ` Jon S Anthony
1997-06-20  0:00             ` GOTO considered necessary (reworked) Robert Dewar
1997-06-17  0:00         ` Robert A Duff
1997-06-19  0:00           ` Spam Hater
1997-06-16  0:00     ` Spam Hater
1997-06-17  0:00       ` Robert Dewar
1997-06-17  0:00         ` Spam Hater
1997-06-14  0:00   ` Samuel Mize
1997-06-14  0:00     ` Matthew Heaney
1997-06-14  0:00   ` Samuel Mize
1997-06-16  0:00 ` Anonymous
1997-06-16  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox