break, continue, return, goto
Peter da Silva
peter at baylor.UUCP
Sun Jan 19 01:46:43 AEST 1986
> > Too many times, programmers are seduced by
> > the use of break for a quick solution without spending time to structure
> > their program more. That is the same lesson we learned from advocating
> > goto-less programs.
>
> Oh, baloney! I happen to think that my use of continue/return/break in
> my code is perfectly well thought out and structured. If you think it's
> not just *BECAUSE* it uses continue/return/break, you're being too hasty.
> BREAK, RETURN AND CONTINUE ARE NOT THE SAME AS GOTO, FOLKS. IF THEY WERE,
> THEY'D ALL BE CALLED "GOTO".
More fuel. I just (Wednesday) went through & put gotos into the main
program of all my little utilities. Why? Because "break" doesn't work
the same way as continue when you're inside a switch. I got sick and
tired of messing with flags & had the choice of either using gotos or
turning my switches (another structured goto, by the way) into if-then-else
chains. It would be nice if 'C' didn't overload keywords this way. Perhaps
'exit' could have been used here.
BTW: I wholeheartedly agree with Michael's comments.
--
-- Peter da Silva
-- UUCP: ...!shell!{baylor,graffiti}!peter; MCI: PDASILVA; CIS: 70216,1076
More information about the Comp.lang.c
mailing list