Goto considered harmful

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(New page: This is not particularly relevant to higher level languages such as Java which do not have goto statements (note that in Java "goto" is a reserved keyword but is not used), but in low leve...)
 
Line 2: Line 2:
  
 
This is because, simply put, goto statements make the behaviour of a program harder to understand. To quote Dijkstra "...the quality of programmers is a decreasing function of the density of go to statements in the programs they produce." The harder a program is the understand, the harder it is to maintain.
 
This is because, simply put, goto statements make the behaviour of a program harder to understand. To quote Dijkstra "...the quality of programmers is a decreasing function of the density of go to statements in the programs they produce." The harder a program is the understand, the harder it is to maintain.
 +
 +
== See also ==
 +
* [[Design maxims]]

Revision as of 02:43, 4 October 2008

This is not particularly relevant to higher level languages such as Java which do not have goto statements (note that in Java "goto" is a reserved keyword but is not used), but in low level languages such as Fortran goto statements are considered bad practice.

This is because, simply put, goto statements make the behaviour of a program harder to understand. To quote Dijkstra "...the quality of programmers is a decreasing function of the density of go to statements in the programs they produce." The harder a program is the understand, the harder it is to maintain.

See also

Personal tools