Differences between version 6 and previous revision of GoToStatementConsideredHarmful.
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 6 | Last edited on Tuesday, December 2, 2003 2:29:48 pm | by AristotlePagaltzis | Revert |
Older page: | version 5 | Last edited on Tuesday, December 2, 2003 4:47:41 am | by StuartYeates | Revert |
@@ -33,13 +33,13 @@
The GoTo statement as it stands is just too primitive; it is too much an invitation to make a mess of one's program. One can regard and appreciate the clauses considered as bridling its use. I do not claim that the clauses mentioned are exhaustive in the sense that they will satisfy all needs, but whatever clauses are suggested (e.g. abortion clauses) they should satisfy the requirement that a programmer independent coordinate system can be maintained to describe the process in a helpful and manageable way.
It is hard to end this with a fair acknowledgment. Am I to judge by whom my thinking has been influenced? It is fairly obvious that I am not uninfluenced by Peter Landin and Christopher Strachey. Finally I should like to record (as I remember it quite distinctly) how Heinz Zemanek at the pre-[Algol] meeting in early 1959 in Copenhagen quite explicitly expressed his doubts whether the GoTo statement should be treated on equal syntactic footing with the assignment statement. To a modest extent I blame myself for not having then drawn the consequences of his remark.
-The remark about the undesirability of the GoTo statement is far from new. I remember having read the explicit recommendation to restrict the use of the go to
statement to alarm exits, but I have not been able to trace it; presumably, it has been made by CharlesAntonyRichardHoare. In [1], Sec. 3.2.1. NicolasWirth and CharlesAntonyRichardHoare together make a remark in the same direction in motivating the case construction: "Like the conditional, it mirrors the dynamic structure of a program more clearly than GoTo statements and switches, and it eliminates the need for introducing a large number of labels in the program."
+The remark about the undesirability of the GoTo statement is far from new. I remember having read the explicit recommendation to restrict the use of the GoTo
statement to alarm exits, but I have not been able to trace it; presumably, it has been made by CharlesAntonyRichardHoare. In [1], Sec. 3.2.1. NicolasWirth and CharlesAntonyRichardHoare together make a remark in the same direction in motivating the case construction: "Like the conditional, it mirrors the dynamic structure of a program more clearly than GoTo statements and switches, and it eliminates the need for introducing a large number of labels in the program."
In [2] Guiseppe Jacopini seems to have proved the (logical) superfluousness of the GoTo statement. The exercise to translate an arbitrary flow diagram more or less mechanically into a jump-less one, however, is not to be recommended. Then the resulting flow diagram cannot be expected to be more transparent than the original one.
References:
[1] NicolasWirth and CharlesAntonyRichardHoare. A contribution to the development of [Algol]. Comm. [ACM] 9 (June 1966), 413-432.
[2] Corrado Böhm and Jacopini Guiseppe. Flow diagrams, Turing machines and languages with only two formation rules. Comm. ACM 9 (May 1966), 366-371.
EdsgerWybeDijkstra %%% Technological [University] %%% Eindhoven, The Netherlands