In 1968, computer scientist Edsger Dijkstra published a highly controversial letter titled 'Go To Statement Considered Harmful.' At the time, programmers routinely used 'GOTO' statements to jump wildly between different lines of code, creating messy, unreadable 'spaghetti code.' Dijkstra argued that GOTO should be banned in favor of structured programming. His letter revolutionized how software is written, steering the industry toward clean, block-based code.
The Disconnect Between Text and Execution
In the early decades of computing, computer programs closely mirrored the underlying mechanics of the hardware. Machine language and assembly instructions relied on primitive jump operations to move execution from one memory address to another. When higher-level languages like Fortran emerged, they inherited this model in the form of the GOTO statement. A GOTO command directed the computer to immediately leap to a specific line number or label elsewhere in the source code, bypassing whatever instructions sat in between.
While this gave developers total freedom to route execution anywhere, it introduced a severe conceptual problem. A programmer reading a printed page of code had no straightforward way to track the path execution would actually take at runtime. A single routine could be entered from dozens of distant locations, and execution could branch in any direction without warning. This tangle of arbitrary jumps earned the moniker spaghetti code, making programs notoriously difficult to debug, maintain, and verify for correctness.
Edsger W. Dijkstra, a Dutch computer scientist, identified this divergence between the static text of a program and its dynamic execution as a fundamental barrier to reliable software engineering. He argued that human beings are poorly equipped to visualize processes that unfold wildly across time unless there is a tight, predictable correspondence between the structure of the written code and the order in which operations execute.
A Famous Letter and an Accidental Title
In March 1968, Dijkstra submitted a brief manuscript outlining his critique to the Communications of the ACM, a leading journal of the Association for Computing Machinery. He originally titled the piece 'A Case Against the GOTO Statement.' In the text, Dijkstra pulled no punches, stating that the quality of programmers was an inversely related function of how frequently they used GOTO statements in their work.
The submission was accepted as a letter to the editor rather than a standard full-length research paper. To expedite publication and fit the format of the journal's correspondence section, the editor, Swiss computer scientist Niklaus Wirth, changed the title to 'Go To Statement Considered Harmful.' Wirth's editorial adjustment gave the piece an urgent, provocative tone that immediately drew the attention of the wider computing community.
Dijkstra's central argument rested on mathematical tractability. He pointed out that when control flow moves strictly through structured blocks, it is possible to define coordinates in the program's progress that allow formal reasoning about its state. Unrestricted jumps destroy these coordinates, turning software verification into a near-impossible guessing game.
The Rise of Structured Programming
Dijkstra was not merely advocating for the removal of a keyword; he was promoting a shift toward what became known as structured programming. This paradigm posits that any computable algorithm can be expressed using only three primary control structures: sequence (executing statements one after another), selection (conditional branching such as if-then-else), and repetition (loops such as while or for).
By restricting program control to these three patterns, structured programming ensures that every execution block has a single entry point and a single exit point. A reader can look at a loop or an if-block and understand its preconditions and postconditions without needing to check if an unrelated routine in another module might jump directly into the middle of it.
Procedures and subroutines further reinforced this model by allowing complex routines to be encapsulated. When a program calls a subroutine, control temporarily shifts to the subroutine and is guaranteed to return to the call site once finished. This predictable flow restored the conceptual link between the spatial layout of the source text and the temporal progression of the running software.
The Counterarguments and Knuth's Balance
The publication of Dijkstra's letter triggered intense resistance across the software industry. Many practicing programmers argued that GOTO statements were essential for achieving maximum execution speed on hardware with constrained memory and limited processing cycles. Others maintained that completely eliminating jumps would force developers to write convoluted boolean flags and deeply nested conditional checks just to manage basic control flow.
The debate reached a major turning point in 1974 when computer scientist Donald Knuth published a comprehensive paper titled 'Structured Programming with go to Statements.' Knuth carefully analyzed practical algorithms and demonstrated that while unconstrained jumps were undeniably dangerous, judicious use of GOTO remained useful in specific programming scenarios.
Knuth highlighted situations such as error handling, recovery routines, and escaping from deeply nested loops, where a direct jump could produce cleaner, faster, and more readable code than rigid structured alternatives. His analysis helped temper the ideological war, establishing that the goal was clarity and correctness rather than the dogmatic avoidance of a single keyword.
The Linguistic and Cultural Aftermath
The structured programming movement ultimately prevailed in shaping the design of modern programming languages. Languages designed in subsequent decades reflect Dijkstra's core philosophy. For instance, languages such as Python and Java omitted unconditional GOTO statements entirely, replacing their valid use cases with dedicated control flow mechanisms such as labeled breaks, continue statements, and structured exception handling using try-catch blocks.
In lower-level systems programming languages like C, the GOTO statement was retained, but its standard application narrowed significantly. In major codebases like the Linux kernel, GOTO is almost exclusively reserved for centralized error-handling blocks at the end of functions, allowing resources to be deallocated in a clean, predictable sequence without duplicating cleanup code.
Beyond its technical impact, Dijkstra's letter left a lasting imprint on technical discourse. The phrasing pattern '[X] Considered Harmful' became one of the most famous snowclones in computer science and technology writing. For decades following the 1968 publication, researchers and essayists used variations of the title to challenge conventional wisdom on topics ranging from software architectures to hardware standards.
Key takeaways
•Dijkstra argued that unconstrained GOTO statements created an unmanageable gap between how code is written on the page and how it executes over time.
•The famous title 'Go To Statement Considered Harmful' was created by editor Niklaus Wirth to speed up publication, replacing Dijkstra's original title.
•The controversy led to the widespread adoption of structured programming, which limits control flow to sequences, conditionals, and loops with single entry and exit points.
•Donald Knuth later provided a balanced defense showing that GOTO remained useful in specific cases like multi-level loop exits and error cleanup.