Where Does GOTO Go to?

Although GOTO has long been criticized for being “unstructured” and causing “unreliable” programs, it is still in use and even modern languages like Ada95 provide GOTO. Why? This paper presents the results of a study in which we examined 316 MB of Ada source code in order to find the frequency and typical applications of GOTO. It turned out that about 99% of all examined files do not contain any GOTO, but we also found “spaghetti code”, generally justified by efficiency arguments. We analyzed whether GOTO really improved efficiency and examined sources containing GOTO by code inspection in order to determine its typical applications.

[1]  S. J. Young,et al.  The programming language ADA reference manual: Springer-Verlag (1981) pp 243, $7.90, DM 16.50 , 1982, Microprocess. Microsystems.

[2]  Edsger W. Dijkstra,et al.  Go To Statement Considered Harmful , 2022, Software Pioneers.

[3]  Robert Griesemer,et al.  A programming language for vector computers , 1993 .

[4]  Marc Michael Brandis Optimizing compilers for structured programming languages , 1995 .

[5]  Mark N. Wegman,et al.  An efficient method of computing static single assignment form , 1989, POPL '89.

[6]  Edsger W. Dijkstra,et al.  Letters to the editor: go to statement considered harmful , 1968, CACM.

[7]  Donald E. Knuth,et al.  An empirical study of FORTRAN programs , 1971, Softw. Pract. Exp..

[8]  Frances S. Grodzinsky,et al.  The anatomy of programming languages , 1993 .

[9]  Michael Wolfe,et al.  High performance compilers for parallel computing , 1995 .

[10]  Joe D. Warren,et al.  The program dependence graph and its use in optimization , 1987, TOPL.

[11]  Laurie J. Hendren,et al.  Taming control flow: a structured approach to eliminating goto statements , 1994, Proceedings of 1994 IEEE International Conference on Computer Languages (ICCL'94).

[12]  Paul Havlak,et al.  Construction of Thinned Gated Single-Assignment Form , 1993, LCPC.

[13]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[14]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..