[TUHS] I can't drive 55: "GOTO considered harmful" 55th anniversary

Dan Cross crossd at gmail.com
Sat Mar 11 02:04:19 AEST 2023


On Fri, Mar 10, 2023 at 10:37 AM Noel Chiappa <jnc at mercury.lcs.mit.edu> wrote:
>[snip]
> I think the point is that goto's aren't necessarily _always_ bad, in and of
> themselves; it's _how_, _where_ and _why_ one uses them. If one uses goto's
> in a _structured_ way (oxymoronic as that sounds), to get around things that
> are lacking in the language's flow-control, they're probably fine.

Something that I think was likely a useful outcome of Djikstra's
polemic is that people began looking at what they were using goto for
and the things that were useful were extracted and codified as
first-class mechanisms in lots of languages (e.g., `break` and
`continue` for loops; exceptions; early function returns;
multilevel-break where that's a thing in a particular language, etc).
Goto is sort of like a hammer stone, it's useful for all kinds of
things, but it's difficult to control without practice and patience.
You can probably cut a diamond with one, but why endure the difficulty
and take the risk if you have access to a jeweler's hammer?

        - Dan C.


More information about the TUHS mailing list