Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!sunquest!ggg From: ggg@sunquest.UUCP (Guy Greenwald) Newsgroups: comp.lang.c Subject: Re: The final word on GOTO (Don't I wis Summary: Goto's redundant Message-ID: <526@sunquest.UUCP> Date: 9 Oct 89 15:32:23 GMT References: <20324@<1989Sep14> <225800222@uxe.cso.uiuc.edu> <4208@cbnewsh.ATT.COM> <6396@ficc.uu.net> Distribution: na Organization: Sunquest Information Systems, Tucson Lines: 46 The structure switch(c) { case 'd': ... goto something; case 'u': ... goto something; ...: ... goto something; something: /* Where's the default? */ } can easily be replaced with switch(c) { case 'd': ... something(); break; case 'u': ... something(); break; ...: ... something(); break; default: ... break; } with no loss of clarity. Other transformations are possible, too. The fact that some standard library implementation uses it isn't convincing, either. I had to write my own strpbrk for VAX C because the standard library routine performed miserably for the long strings my code was processing (10K+). Useful routines can be poorly implemented. The first implementation given above will execute slightly faster than the second, but why is it "easier to read?" I can't see that the goto's are really necessary. (something() could be implemented as a macro if it needs to be faster.)