Jonathan S. Shapiro
Fri, 6 Feb 1998 13:32:23 -0500
Perhaps you need to reread the old Dijkstra note "Goto considered
harmful." If goto is bad, interrupts, by whatever name, are worse.
MINOR RANT on Dijkstra:
Dijkstra's position is both presumptuous and oversimplified.
At the very least, a multilevel break statement is essential; Dijkstra
himself has agreed with this. His later language efforts include
nested exception handling, which is more relevant to the question of
Dijkstra's position presumes that programmers can generally be relied
on to abuse power tools. This is sadly supported by the evidence, but
no less paternalistic for that.
Dijkstra's position ignores issues of legibility, complexity, and
performance. In several cases I can think of off the top of my head,
it is *possible* to reorganize code so as to avoid gotos, but the
resulting code is unmaintainable because doing so has sacrificed
Dijkstra's position ignores performance. The current state of compiler
technology is such that compilers are unable to optimize out many of
those transformations; in some cases the performance consequence is
quite serious -- the EROS IPC path is a case in point.
In summary, gotos are a power tool. They are readily abused and
should be subject to scrutiny, but they are sometimes essential.