Where does GOTO Go to?

  • Wolfgang Gellerich
  • Markus Kosiol
  • Erhard Ploedereder
The Ada 95 Programming Language
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1088)


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.


GOTO evaluation of programming techniques 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ada 95 Reference Manual Intermetrics, Inc., 1995, ANSI/ISO/IEC-8652:1995.Google Scholar
  2. 2.
    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).Google Scholar
  3. 3.
    M.M. Brandis. Optimizing Compilers for Structured Programming Languages. PhD thesis, ETH Zuerich, 1995. ftp.inf.ethz.ch:/doc/diss/th11024.ps.gz.Google Scholar
  4. 4.
    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.Google Scholar
  5. 5.
    E.W. Dijkstra. Goto Statement Considered Harmful. Communications of the ACM, 11(3):147–148, March 1968.Google Scholar
  6. 6.
    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.Google Scholar
  7. 7.
    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.Google Scholar
  8. 8.
    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.Google Scholar
  9. 9.
    A.E. Fischer and F.S. Grodzinsky. The Anatomy of Programming Languages. Prentice-Hall, 1993.Google Scholar
  10. 10.
    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).Google Scholar
  11. 11.
    Gnu ada translator (gnat) documentation, 1995. (ftpcs.nyu.edu:/pub/gnat).Google Scholar
  12. 12.
    G. Goos and J. Hartmanis (eds). The Programming Language Ada Reference Manual. Springer, 1983.Google Scholar
  13. 13.
    R. Griesemer. A Programming Language for Vector Computers. PhD thesis, ETH Zuerich, 1993. ftp.inf.ethz.ch: /doc/diss/th10277.ps.gz.Google Scholar
  14. 14.
    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.Google Scholar
  15. 15.
    B.W. Kernighan and D.M. Ritchie. The C programming language. Prentice Hall, 2. edition, 1988.Google Scholar
  16. 16.
    D.E. Knuth. An Empirical Study of Fortran Programs. Software — Practice and Experience, 1:105–133, 1971.Google Scholar
  17. 17.
    K.C. Louden. Programming Languages. PWS-KENT Publishing Company, 1993.Google Scholar
  18. 18.
    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).Google Scholar
  19. 19.
    R.W. Sebesta. Concepts of Programming Languages. The Benjamin-Cummings Publishing Company, 2. edition, 1993.Google Scholar
  20. 20.
    J. Self. Aflex — An Ada Lexical Analyzer Generator. Technical Report UCI-90-18, University of California, Irvine, May 1990.Google Scholar
  21. 21.
    B. Stroustrup. The C++ Programming Language. Addison-Wesley, 2. edition, 1993.Google Scholar
  22. 22.
    D. Taback and D. Tolani. Ayacc User's Manual. Technical Report UCI-94-01, University of California, Irvine, March 1994.Google Scholar
  23. 23.
    M.J. Wolfe. High-Performance Compilers for Parallel Computing. Addison-Wesley, 1995.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Wolfgang Gellerich
    • 1
  • Markus Kosiol
    • 1
  • Erhard Ploedereder
    • 1
  1. 1.Department of Computer ScienceUniversity of StuttgartStuttgartGermany

Personalised recommendations