Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mimsy!umd5!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: goto's in C: an opinion... Message-ID: <6172@brl-smoke.ARPA> Date: Sat, 25-Jul-87 05:09:39 EDT Article-I.D.: brl-smok.6172 Posted: Sat Jul 25 05:09:39 1987 Date-Received: Sat, 25-Jul-87 22:04:19 EDT References: <3289@bigburd.PRC.Unisys.COM> <7571@beta.UUCP> <4437@jade.BERKELEY.EDU> <556@l.cc.purdue.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 33 In article <556@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes: - ..... -mod: ..... - ..... - if(....)goto terma; - .... - if(...)goto termb; - ... - if(......)goto termc; -h: .... - if(.....)goto terma; - .... - goto h; -terma: ......; - goto mod; -termb; ....; - goto merge; -termc; ....; -merge: ....; goto finish; -termd: ....; -finish: ....;} -as well as other goto's internally in the code. That's an example of the sort of thing that gave GOTO a bad name. If you draw connecting paths between the gotos and their targets, you get the infamous "spaghetti". It is always POSSIBLE that such code is correct, but it is not patent from its structure. Indeed, it's not even clear that the branching necessarily terminates, and the termination condition if written out would be exceedingly complex. By the way, how is label "termd" reached? Are you sure this code is correct? Would you be comfortable making serious revisions to it a few years from now? I really can't recommend this style of coding.