Channel Button

There are 3 articles on this title. You are reading the article ranked and rated #2 by Helium's members.

Computers & Technology   >

Software & Web Development

Get a Widget for this title

History of the 'goto' command

Ever since the late 1970s, new programming students have been taught how to use a simple instruction called GOTO, yet are told never to use it. When asked why, the usual responses given by teachers tend to range from "because I said so" to "because it is the standard industry practice," depending on the focus of the class or course.

GOTO is simple enough to understand. When a system encounters a GOTO instruction, it "jumps" from executing code at one part of the program, to executing code at a different part. The ability to do this is part of how computers are able to do more than function as advanced calculators. On the machine code level, GOTO is a fundamental part of all programs. Instructions to jump from one part of a program to another are executed over and over again, sometimes hundreds of times, to perform a single high-level program statement, so why is specifying this sort of jump at a higher level frowned upon?

The answer to this may be traced back to the earliest roots of modern programming languages. In the days of FORTRAN and COBOL, coding practice allowed free reign of GOTO statements. In fact, they were necessary to perform almost any form of useful program. However, as programs became longer and more complex, and multiple programmers had to work on maintaining them, programs that jumped from one place to another over and over again become a nightmare to maintain, improve, or even understand. The term "spaghetti code" was coined, as it reflected the way that program execution was threaded throughout vast piles of instructions, jumping throughout in a jumbled mess.

To combat this tendency of code to become unmanageable, newer practices were developed. These were based on stricter program structures, such as formally defined subroutines and functions with only one entrance and exit, and later still object oriented methods and classes. These could be followed easier than spaghetti code, and thus explicit GOTO statements fell into disuse, even though they were still permitted by the programming languages. In recent years, some programming languages, such as Java, do not even have this command, which was once the backbone of computing itself, and in languages that do support the command, it is looked down upon by many people who do not even know it's history.

Learn more about this author, Kristopher Chambers.
Contact this writer Click here to send this author comments or questions.


Below are the top articles rated and ranked by Helium members on:

History of the 'goto' command

  • 1 of 3

    by Lam Luu

    The discussion of goto command is, undoubtedly, among the most interesting discussion in early software engineering discipline.

    read more

  • 2 of 3

    by Kristopher Chambers

    Ever since the late 1970s, new programming students have been taught how to use a simple instruction called GOTO, yet are

    read more

  • 3 of 3

    by David Harris

    The "goto" command (strictly speaking it's a "keyword" and not a "command") first showed up in the original high level languages

    read more

Add your voice

Know something about History of the 'goto' command?
We want to hear your view. Write_penWrite now!

Helium Debate

Cast your vote!

Which is better, Windows Media Player 11 or Windows Media Player 10 and why?

Click for your side.

100468

Featured Partner

Charity Music

Charity Music is a nonprofit public service organization that loans musical instruments free of charge to individua...more

What is Helium? | Buy Web Content | Contact Us | Privacy | User agreement | DMCA | User Tools | Help | Community | Helium’s Official Blog | Link to Helium

Helium, Inc.
200 Brickstone Square Andover, MA 01810 USA