BBC Home

Explore the BBC

h2g2
24th December 2009
Accessibility help
Text only

Guide ID: A354629 (Edited)

Edited Guide Entry


SEARCH h2g2
Edited Entries only
Search h2g2Advanced Search


New visitors: Create your membership
Returning members: Sign in
BBC Homepage
The Guide to Life, The Universe and Everything.

3. Everything / Languages & Linguistics / Languages / Computer Languages
3. Everything / Maths, Science & Technology / Computers / Computer Languages and Programming

Created: 18th July 2000
The GOTO Statement
Contact Us


Like this page?
Send it to a friend!

 

GOTO is a statement in some computer languages with which the order of execution of a program can be controlled. In short, GOTO tells the program to continue its execution not at the next statement as usual but at another statement.

The use of GOTO as a statement in programming languages such as BASIC, COBOL and others, has become a religious issue. Newbie programmers in the aforementioned languages are likely to use GOTO statements in large quantities, resulting in 'spaghetti' code that nobody, even the author, could ever follow or maintain. Computer scientists in general detest the use of GOTO; see Edsger W Dijkstra's 1968 note 'GOTO Statement Considered Harmful' (this note, among other publications, started the 'structured programming' holy wars).

It must be stated, however, that the GOTO statement is at times very useful to get around the lack of a better structure in the language, for certain types of loops for instance, and could also be essential for error trapping.

Amusingly, program code completely without GOTOs, sufficient size and complexity provided, is equally hard to maintain, regardless which programming language is used.



Clip/Bookmark this page
This article has not been bookmarked.
ENTRY DATA
Written and Researched by:

SchrEck Inc.

Edited by:

Alaska

Referenced Entries:

Computers
Seven Secrets of Successful Programmers
COBOL - the Programming Language
BASIC - the Programming Language

Related BBC Pages:

Information Technology - ...

Referenced Sites:

GOTO Statement Considered...

Please note that the BBC is not responsible for the content of any external sites listed.


CONVERSATION TOPICS FOR THIS ENTRY:

Start a new conversation

People have been talking about this Guide Entry. Here are the most recent Conversations:

TITLE
LATEST POST
In some languages, such as BASIC & Qbasic...Jun 4, 2005
The ONE proper use of GOTOApr 27, 2005
A proper use of GOTOSep 8, 2003
The h2g2 association for the abolition of gotos...Jun 3, 2003
sometimes usefullJun 21, 2002
Use them sensiblySep 7, 2001
Updated 10 August, 2001Aug 10, 2001
related pagesApr 3, 2001
Real ProgrammersJul 19, 2000
"There I was..." -- stories of GOTOJul 19, 2000

More Conversations


Disclaimer

Most of the content on h2g2 is created by h2g2's Researchers, who are members of the public. The views expressed are theirs and unless specifically stated are not those of the BBC. The BBC is not responsible for the content of any external sites referenced. In the event that you consider anything on this page to be in breach of the site's House Rules, please click here. For any other comments, please start a Conversation above.




About the BBC | Help | Terms of Use | Privacy & Cookies Policy