The final word on GOTO (Don't I wis
Jim Giles
jlg at lanl.gov
Fri Oct 13 08:13:22 AEST 1989
>From article <566 at sunquest.UUCP>, by ggg at sunquest.UUCP (Guy Greenwald):
> /* Really: */
> case whatever:
> special-code...;
> goto common;
> /* Is no clearer than: */
/* But it IS _MUCH_ more efficient than: */
> case whatever:
> special-code...;
> common();
> break;
Also, which one is clearer depends on the context. I've seen a lot
of code in which the GOTO version is much clearer because it doesn't
separate the common code from the rest by a factor of several pages.
In any event, the GOTO may be imperative for the efficiency alone.
And you can't necessarily do better than the GOTO - even if you have
inline procedures. Part of your efficiency requirement may be to
minimize the size of the code.
More information about the Comp.lang.c
mailing list