Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!pacbell!att-ih!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.lang.c Subject: Re: Put your code where your mouth is (was Re: gotos) Message-ID: <2595@ttrdc.UUCP> Date: 21 Apr 88 21:31:25 GMT References: <1988Apr11.201934.20594@utzoo.uucp> <451@goofy.megatest.UUCP> <1988Apr20.072000.384@utzoo.uucp> Organization: AT&T, Skokie, IL Lines: 23 Summary: you thought it was worth your time to blither against gotos In article <1988Apr20.072000.384@utzoo.uucp>, henry@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,!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.