Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!husc6!rutgers!labrea!decwrl!decvax!ima!haddock!karl
From: karl@haddock.ISC.COM (Karl Heuer)
Newsgroups: comp.lang.c
Subject: Re: goto's in C: an opinion...
Message-ID: <765@haddock.ISC.COM>
Date: Mon, 20-Jul-87 18:23:16 EDT
Article-I.D.: haddock.765
Posted: Mon Jul 20 18:23:16 1987
Date-Received: Wed, 22-Jul-87 02:07:25 EDT
References: <3289@bigburd.PRC.Unisys.COM> <7571@beta.UUCP>
Reply-To: karl@haddock.ISC.COM (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 25
Keywords: C, goto, style

In article <7571@beta.UUCP> hwe@beta.UUCP (Skip Egdorf) writes:
>In any language that supports a complete set of structured constructs,
>there is NO NEED for a goto, and the statement should be removed from
>the language!

The statement is true with the qualifier.  However, I do not know any language
that supports what I would consider a "complete set" of structured constructs.
Perhaps ADA does, but I'm not sure I want to use something that big.

>Languages that do not have enough control structure should be used only
>with a pre-processor (e.g. Fortran and Ratfor).

Not always feasible.  Yes, if there's a Ratfor available I'll use it and avoid
the goto as much as possible.  But if I'm coding in C, it's unlikely that the
construct I need occurs so often that it's worthwhile to use a new language.

As for removing it from the language -- that has happened in the Bourne shell,
and it's a pain having to kludge around it.  (Still, it's better than the old
"goto" shell.)

For the record, I do not use goto very often.  When I do, it's usually for
error-handling (even then, I prefer "usage()" to "goto usage").  I've also
been known to implement coroutines using goto.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint