gotos

Dave Decot decot at hpisod2.HP.COM
Sun Apr 10 16:01:12 AEST 1988


> For me, the hardest thing to handle is real long blocks.  You know,
> the things delimited by curly braces:
> 
> 
>   for(; foo = bar; bleep < blap)
> 	{
> 	   /* a skillion lines of code omited. */
>         }
> 
> It's SO hard to figure out where the darn thing starts and where it ends.
> And if their are "breaks" and "continues", yech.  When that happens,
> in these long blocks, I would prefer a "done:" label at the end and
> "gotos" rather than "breaks".  That way, I can at least search for the label.
> 
> Maybe we shoud start a raging argument about whether long blocks are
> _considered_harmful_.  Shouldn't be much argument there.

Yes.  The solution is not to introduce a label; it is to break up the long
blocks into appropriate separate functions.

Dave "I use gotos to get fully out of nested loops" Decot
hpda!decot



More information about the Comp.lang.c mailing list