Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ecsvax.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!ecsvax!dgary From: dgary@ecsvax.UUCP (D Gary Grady) Newsgroups: net.lang.c Subject: Re: "break" statements Message-ID: <664@ecsvax.UUCP> Date: Thu, 31-Oct-85 10:31:48 EST Article-I.D.: ecsvax.664 Posted: Thu Oct 31 10:31:48 1985 Date-Received: Sat, 2-Nov-85 06:08:16 EST References: <195@codas.UUCP> <723@mmintl.UUCP> <258@3comvax.UUCP> Distribution: net Organization: Duke U Comp Ctr Lines: 33 > These break statements are just a way to disguise a goto statement. Why stop with break statements? The switch statement is just a way of disguising a multiway GOTO! While, for, and do statements are merely GOTOs and conditional GOTOs in Clever Plastic Disguises! > The only thing wrong with goto statements (I never use them) is > that they make code hard to understand. > Michael Shannon {ihnp4,hplabs}!oliveb!3comvax!mikes The reason true GOTO statements are hard to understand is that it is impossible to tell at a glance whither they go (up? down?) and it makes it damned hard at the target address to figure whence cometh the flow. By careful indentation (and the wise avoidance of the sin of long loops) one can avoid these failings of the GOTO and still have the advantages of break (and continue). For example: while ... { ...statements... if ... break; ...statements... } By the way, note how a reasonable word of advice ("don't use GOTOs") can be transformed by religious fervor into an absolute prohibition ("thou shalt not use GOTOs or anything that could be remotely construed as a GOTO, or thine arse is like unto the grass of the fields, thou sucker"). -- D Gary Grady Duke U Comp Center, Durham, NC 27706 (919) 684-3695 USENET: {seismo,decvax,ihnp4,akgua,etc.}!mcnc!ecsvax!dgary