using break <label> instead of goto <label>

Doug Gwyn (VLD/VMB) gwyn at Brl-Vld.ARPA
Fri Jan 11 18:22:36 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.



More information about the Comp.lang.c mailing list