Put your code where your mouth is (was Re: gotos)

Daniel R. Levy levy at ttrdc.UUCP
Fri Apr 22 07:31:25 AEST 1988


In article <1988Apr20.072000.384 at utzoo.uucp>, henry at utzoo.uucp (Henry Spencer) writes:
# > # Also left as an exercise for the reader is finding the bug in Knuth's
# > # hash-table-search code.
# 
# For those who don't feel like studying the code, the bug is that the
# code infinite-loops if the table is full.  One wonders whether Knuth would
# have noticed this if he'd tried to avoid the gotos.
# 
# > Mr. Spencer, put your code where your mouth is.  For each goto example in
# > Knuth, show us how you would code it to run equally efficiently without
# > gotos.  Fair enough?
# 
# To put it bluntly, it's not worth my time.  In most cases the obvious goto-
# free code is just as efficient as Knuth's, given a modern compiler.  Much
# of what Knuth is discussing can be seen as ways of hand-coding the sort
# of optimizations that modern compilers do without being asked.

Nice show of arrogance but any reasonable reader must conclude that you have
not proved your case.  You somehow found plenty of time to rail against gotos.
-- 
|------------Dan Levy------------|  Path: ihnp4,<most AT&T machines>!ttrdc!levy
|              AT&T              |  I'm not a real hacker, but I play one on
|       Data Systems Group       |  USENET.  If you think that AT&T endorses
|--------Skokie, Illinois--------|  my opinions, I've a nice bridge to sell ya.



More information about the Comp.lang.c mailing list