gotos

Henry Spencer henry at utzoo.uucp
Sat Apr 16 03:07:53 AEST 1988


> The best collection of thoughts I have seen on this issue is by Donald
> Knuth, entitled "Structured Programming with goto Statements"...

The amusing thing about Knuth's article is that when you subtract out the
search loops (which can be handled with break or return), the syntax
example (which can be done *much* more elegantly using ungetc()), and the
things that any modern compiler (NB the 4BSD VAX compiler is an antique)
would look after for you... there's nothing left!

Also left as an exercise for the reader is finding the bug in Knuth's
hash-table-search code.  (He might possibly have corrected this in the
reprint; my copy is the original Computing Surveys paper.)  The hazards
of gotos doth make fools of the best of us...
-- 
"Noalias must go.  This is           |  Henry Spencer @ U of Toronto Zoology
non-negotiable."  --DMR              | {allegra,ihnp4,decvax,utai}!utzoo!henry



More information about the Comp.lang.c mailing list