gotos

Rahul Dhesi dhesi at bsu-cs.UUCP
Thu Apr 14 04:49:51 AEST 1988


In article <451 at goofy.megatest.UUCP> djones at megatest.UUCP (Dave Jones) writes:
>I only stated that the importance which some people place
>on avoiding the gotos is exceedingly exaggerated, and that time spent
>campaigning against its use is misspent.

This is indeed very true.  It is not always wise to simply criticize
gotos instead of asking why a goto was necessary.   It could be lousy
algorithm design or, more commonly than you think, less-than-perfect
programming language design.  Some things are best done with a goto!
And I know of no language, with the possible exception of Ada, that is
rich enough in control structures to always have an elegant and
efficient alternative to using a goto.

The best collection of thoughts I have seen on this issue is by Donald
Knuth, entitled "Structured Programming with goto Statements",
originally published in one of the ACM journals (probably Computing
Surveys) circa 1974 and republished by Prentice Hall in 1977 in
"Current Trends in Programming Methodology" volume I, edited by Raymond
T. Yeh.
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee,uunet}!bsu-cs!dhesi



More information about the Comp.lang.c mailing list