Search Helium

Home > Computers & Technology > Software > Software & Web Development

History of the 'goto' command

by Kristopher Chambers

Created on: May 05, 2008

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.
Click here to send this author comments or questions.

Helium Debate

Cast your vote!

Will Internet Explorer 8 solve Microsoft's Web browser problems?

Click for your side.

121751

Featured Partner

Sunshine Week

Sunshine Week is a nonpartisan, good-government effort led by the American Society of Newspaper Editors, but with a constituency that goes beyond print, broadcast and online news media to include students of all ages; federal, state and ...more


CONNECT WITH US

Read
our blog
Helum for writers

Write and get published
Share with other writers
Polish your freelancing skills

Join our active writing community
Helium Content Source for Publishers

Quality articles from proven freelancers
Exclusive rights, fast turnaround
Brand engagement, business blogging -- our writers do it all

Get custom content today!

INFORMATION


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