Abstract
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.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
Ada 95 Reference Manual Intermetrics, Inc., 1995, ANSI/ISO/IEC-8652:1995.
M. M. Brandis. Building an Optimizing Compiler for Oberon: Implications on Programming Language Design. In P. Schulthess, editor, Advances in Modular Languages, pages 123–135. Universitaetsverlag Ulm GmbH (address: Postfach 4204; D-89032 Ulm; Germany), 1994. (Proceedings of the Joint Modular Languages Conference 1994).
M.M. Brandis. Optimizing Compilers for Structured Programming Languages. PhD thesis, ETH Zuerich, 1995. ftp.inf.ethz.ch:/doc/diss/th11024.ps.gz.
R. Cytron, J. Ferrante, B.K. Rosen, M.N. Wegman, and F.K. Zadeck. An Efficient Method of Computing Static Single Assignment Form. In 16nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 25–35. ACM, 1989.
E.W. Dijkstra. Goto Statement Considered Harmful. Communications of the ACM, 11(3):147–148, March 1968.
A.M. Erosa and L.J. Hendren. Taming control flow: A structured approach to eliminating goto statements. In Proceedings of IEEE 1994 International Conference on Computer Languages, May 1994. ftpwally.cs.mcgill.ca/pub/doc/memos/memo76.ps.gz.
R. Cytron et al., Efficiently Computing Single Single Assignment Form and the Control Dependence Graph. ACM Transactions on Programming Languages and Systems, 13(4):451–490, 1991.
J. Ferrante, K.J. Ottenstein, and J.D. Warren. The Program Dependence Graph and its Use in Optimization. ACM Transactions on Programming Languages and Systems, 9(3):319–349, July 1987.
A.E. Fischer and F.S. Grodzinsky. The Anatomy of Programming Languages. Prentice-Hall, 1993.
Free Software Foundation, 59 Temple Place — Suite 330, Boston, MA 02111-1307 USA. Using and Porting GNU CC, 1995. (for GCC Version 2.7.2).
Gnu ada translator (gnat) documentation, 1995. (ftpcs.nyu.edu:/pub/gnat).
G. Goos and J. Hartmanis (eds). The Programming Language Ada Reference Manual. Springer, 1983.
R. Griesemer. A Programming Language for Vector Computers. PhD thesis, ETH Zuerich, 1993. ftp.inf.ethz.ch: /doc/diss/th10277.ps.gz.
P. Havlak. Construction of Thinned Gated Single-Assignment Form. In U. Banerjee, D. Gelernter, A. Nicolau, and D. Padua, editors, Languages and Compilers for Parallel Computing, pages 478–499, 1993.
B.W. Kernighan and D.M. Ritchie. The C programming language. Prentice Hall, 2. edition, 1988.
D.E. Knuth. An Empirical Study of Fortran Programs. Software — Practice and Experience, 1:105–133, 1971.
K.C. Louden. Programming Languages. PWS-KENT Publishing Company, 1993.
Rational Software Corporation, 2800 San Tomas Expressway, Santa Clara, California 95051-0951. Rational Apex Programmer's Reference Manual, December 1993. Revision 2.0 (software release 1.2).
R.W. Sebesta. Concepts of Programming Languages. The Benjamin-Cummings Publishing Company, 2. edition, 1993.
J. Self. Aflex — An Ada Lexical Analyzer Generator. Technical Report UCI-90-18, University of California, Irvine, May 1990.
B. Stroustrup. The C++ Programming Language. Addison-Wesley, 2. edition, 1993.
D. Taback and D. Tolani. Ayacc User's Manual. Technical Report UCI-94-01, University of California, Irvine, March 1994.
M.J. Wolfe. High-Performance Compilers for Parallel Computing. Addison-Wesley, 1995.
Author information
Authors and Affiliations
Corresponding author
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Gellerich, W., Kosiol, M., Ploedereder, E. (1996). Where does GOTO Go to?. In: Strohmeier, A. (eds) Reliable Software Technologies — Ada-Europe '96. Ada-Europe 1996. Lecture Notes in Computer Science, vol 1088. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0013504
Download citation
DOI: https://doi.org/10.1007/BFb0013504
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61317-6
Online ISBN: 978-3-540-68457-2
eBook Packages: Springer Book Archive