Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/17/84; site opus.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!hao!cires!nbires!opus!rcd
From: rcd@opus.UUCP (Dick Dunn)
Newsgroups: net.lang.c
Subject: Re: Re: Breaking out of several nested loops
Message-ID: <880@opus.UUCP>
Date: Thu, 11-Oct-84 15:36:32 EDT
Article-I.D.: opus.880
Posted: Thu Oct 11 15:36:32 1984
Date-Received: Sat, 13-Oct-84 02:21:18 EDT
References: <129@ssc-vax.UUCP>
Distribution: net
Organization: NBI,Inc, Boulder CO
Lines: 29

> >> The correct way to break out of multiply nested control constructs (using the
> >> example in the referenced article) without using 3 separate boolean flags is:
>...
> >> 	while(...){
>...
> >> 				goto Out;
> 
> 	Very UNstructured!!!!!!!!!!
> 
> 	Try the following:

...and the parent article suggests ripping this nest out into a separate
procedure which has, as parameters, all of the variables needed in the nest
of control constructs--this allows replacing the "goto" with a "return". 
I guess the trailing-line-eater bug got the parent article, 'cause there
wasn't a ":-)" at the end.

I'm sure glad to see that someone would violate all concepts of modularity
(yanking part of the innards out of a procedure), clean interface (defining
a new procedure without regard to how many parameters might be needed),
and, dare I say the word, efficiency.  No, really, I AM glad about that,
because the more "programmers" there are who bow to the sacred "structured"
idol and who stupidly believe "structured"=="no goto's", the longer I will
be able to be paid an absurdly high salary for being able to produce real
software (though it's sometimes painful to do maintenance on code written
by a "structured code" dogmatist).
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...Relax...don't worry...have a homebrew.