break <label> and another use for goto's.

Martin Minow minow at decvax.UUCP
Fri Jan 11 09:40:10 AEST 1985


break <label> failed to win widespread acceptance because
people couldn't agree where the label goes (anywhere, or
should it label the "proper" enclosing block, or what.

Goto, as noted, gives the necessary piece of information
and can serve as a visible warning that something special
is going on.

While scanning the source of a module done by one of
my collegues, I noticed a label at the start of a module.
"Why did you need a goto here?"

His reply was that he uses

	label:	...
		goto label;

to delimit an outer loop that goes on for several pages as
you can easily lose visual track of {...} nesting levels.

The moral is that goto is a perfectly valid addition to
a programmer's toolkit and that squeezing the last goto
out of a module may make it less maintainable even though
it improves the module's "structuredness".

Martin Minow
decvax!minow



More information about the Comp.lang.c mailing list