using break <label> instead of goto <label>

Ron Natalie <ron> ron at brl-tgr.ARPA
Wed Jan 16 06:29:14 AEST 1985


> I really think the discussion of "goto" in C is overblown.
> I just grepped through over 6,000 lines of production C code
> and found one instance of goto used as an EOF exception escape
> and 7 instances (in the same module) of gotos to a common error
> return.  Not a single goto for any other purpose, including
> multi-level breaks.  I would argue that this code exhibits
> why "goto" can be useful and that the "dangerous" uses of it
> can be totally avoided.  Perhaps programmer education is more
> important than changing the language.

Yes, this is an indication that the reason most good programmers
place non-structured constructs in their code is to avoid code
duplication.

-Ron



More information about the Comp.lang.c mailing list