break, continue, return, goto (net.religion.c)

Mike Shannon mikes at 3comvax.UUCP
Thu Nov 7 09:13:07 AEST 1985


More from Mike Baldwin:
> 	for (X) {
> 		/******************/
> 		/* masses of code */
> 		/******************/
> 		if (error) {
> 			bleck;
> 			continue;
> 		}
> 		/******************/
> 		/* masses of code */
> 		/******************/
> 	}

	I often see good reason for break/continue when parsing arguments
or other input (usually from a human) which may be of the form:
SomeGoodStuff SomeGarbage SomeMoreGoodStuff
	But I *really* (religiously? :-)) question whether the above 'for'
statement is good top-down design.  I think I would at least re-code
the above as:
	for(x) {
		if(p1() != error) {
			p2();
		}
		else {
			bleck;
		}
	}

	If code bulk is causing readibility problems, rework your solution
from the top down.  Procedurize and reduce code bulk.
[In Nomine Patri, et Fili, et Spiritu Santu. Amen.]
-- 
			Michael Shannon {ihnp4,hplabs}!oliveb!3comvax!mikes



More information about the Comp.lang.c mailing list