Edsger W. Dijkstra

The Discipline of Correctness and the Elimination of the GOTO
Edsger W. Dijkstra

In the late 1950s and early 1960s, programming was practiced as an undisciplined black art. The computer was an expensive, fragile colossus of vacuum tubes and magnetic core memory, and the programmer was regarded as a clever puzzle-solver whose value lay in squeezing code into impossibly small memory banks through baroque register tricks. Program logic was stitched together with arbitrary jumps—the ubiquitous GOTO statement—scattering control flow across memory in tangled, spaghetti-like trajectories. When a system malfunctioned, programmers treated the failure as an inevitable physical mystery. They poked at running code with temporary patches, ran test batches through the punch-card reader, and celebrated if a test case happened to output the expected numbers.

Edsger Wybe Dijkstra, a young Dutch theoretical physicist working at the Mathematisch Centrum in Amsterdam, looked upon this burgeoning industry with profound distaste. He saw an engineering culture sleepwalking into catastrophe. As hardware capacity grew by orders of magnitude, software complexity was ballooning far beyond the grasp of the human intellect. Testing, Dijkstra realized, was an epistemic trap: program testing can be used very effectively to show the presence of bugs, but is hopelessly inadequate for showing their absence. An algorithm could pass ten thousand test cases and still collapse on the ten-thousand-and-first into an untested pathological state.

To Dijkstra, programming was not an empirical craft or a branch of electrical engineering. It was the most demanding branch of applied mathematics humanity had ever attempted. If software was to be trusted with human lives, telephone exchanges, and power grids, correctness could never be an afterthought patched onto running code; it had to be mathematically derived alongside the program itself.


The first demonstration of Dijkstra's singular clarity arrived in the morning of 1956, during a café visit in Amsterdam with his fiancée, Maria. The Mathematisch Centrum was preparing to unveil the ARMAC computer, and Dijkstra needed a compelling demonstration problem that a non-technical audience could instantly grasp. He chose to find the shortest driving route between sixty-four Dutch cities.

Sitting at the café table without paper or pencil, he worked out the solution in twenty minutes. Rather than evaluating every possible route—a combinatorial explosion that would paralyze any machine—Dijkstra conceived the principle of greedy, monotone relaxation.

Imagine starting at a source city. You know the exact distance to your immediate neighbors. The closest neighbor can be permanently locked in: because all road distances are positive, no circuitous detour through other cities could ever reach it more cheaply. From this newly conquered node, you update the tentative distances to all surrounding unvisited cities, pick the closest remaining candidate across the entire frontier, and lock it in. The search frontier expands outward like a steady, calm ripple across a pond. The algorithm required no back-tracking, no trial-and-error, and no speculative leaps. It was mathematically guaranteed to find the absolute shortest path in minimal time.

The shortest-path algorithm became an immediate cornerstone of modern computation. Today, whenever a data packet routes across the optical fiber backbones of the global internet, or a satellite navigation system plots a turn through a city street, it executes the twenty-minute café deduction Dijkstra designed to show off a forgotten Dutch computer.


In the mid-1960s, computing collided with a terrifying new frontier: concurrency. Until then, machines executed programs strictly sequentially, one instruction after another. But the arrival of multiprogramming and operating systems meant that multiple independent processes, along with asynchronous input-output channels, had to share a single central processor and common memory banks.

The result was pandemonium. Processes collided unpredictably, overwriting shared data, clobbering memory registers, and freezing in silent deadlocks. Because these failures depended on minute, microsecond-level timing differences—race conditions—they were virtually impossible to reproduce or debug through testing. Operating systems were collapsing under their own unpredictability.

Dijkstra resolved the crisis by inventing the theoretical foundation of concurrent coordination. In 1965, designing the THE Multiprogramming System at the Eindhoven University of Technology, he introduced the concept of the semaphore. A semaphore was a minimalist, protected synchronization primitive: an integer counter accessible only through two atomic, indivisible operations, which he designated $P$ (from the Dutch proberen, to test or decrease) and $V$ (from verhogen, to increment).

With these two atomic primitives, Dijkstra proved that arbitrary numbers of asynchronous processes could coordinate access to shared critical sections without race conditions, without busy-waiting loops burning clock cycles, and without relying on fragile physical timing assumptions. To ensure that an operating system would never trap itself in a terminal embrace where processes freeze while waiting for each other's resources, he formulated the Banker's Algorithm: a formal protocol for deadlock avoidance that evaluated whether granting a resource request would leave the system in a provably "safe state." He elevated operating systems from an ad-hoc tangle of timing delays into a rigorous calculus of state invariants.


Yet Dijkstra’s most explosive collision with the computing establishment occurred in 1968, when the Communications of the ACM published his letter to the editor. The editor, Niklaus Wirth, gave it a title that would become legendary: "Go To Statement Considered Harmful."

Dijkstra’s thesis struck at the core of the programming ego. The unconditional GOTO statement, he argued, was an intellectual poison. It severed the correspondence between the static physical text of a program on the printed page and its dynamic execution through time. When code was laced with arbitrary jumps, a human being reading a line in the middle of a program had no way of knowing how the machine had arrived there or what preconditions held true. To understand code, one was forced to execute the entire program mentally, tracking thousands of register states across time.

Dijkstra insisted that human cognitive bandwidth was strictly limited. To build systems that could be proven correct, the dynamic execution flow of a program had to mirror its static structural decomposition. Control flow had to be confined strictly to three composable structures: sequential execution, selection (if-then-else), and repetition (while-do).

The reaction from the computing industry was furious. Professional programmers accused Dijkstra of academic arrogance, claiming that stripping away the GOTO would throttle performance, strip them of their expressive freedom, and turn programming into a sterile mathematical exercise. Dijkstra did not blink. Over the next decade, the discipline of Structured Programming swept the globe. The spaghetti architectures collapsed, replaced by the block-structured languages—from Pascal and C to modern Rust and Go—that underpin contemporary software engineering.


In the later decades of his life, ensconced at the University of Texas at Austin, Dijkstra operated almost entirely by hand. He shunned the computer itself, refusing to have one in his office, and composed more than one thousand three hundred formal research manuscripts—the celebrated "EWDs"—using a Montblanc Meisterstück fountain pen, photocopying his handwritten pages and mailing them to colleagues across the world.

He pioneered the field of program derivation, insisting that one should never write a program and then struggle to prove it correct; instead, the program and its formal correctness proof must be synthesized simultaneously, guided by mathematical invariants and weakest precondition semantics. In 1974, he introduced the concept of self-stabilization in distributed systems, demonstrating how an arbitrary network of processors, perturbed into any chaotic, corrupted configuration by hardware noise, could autonomously converge back to legitimate execution without external centralized repair—founding the modern field of resilient distributed systems.

Dijkstra was frequently accused of being dogmatic, acerbic, and merciless toward intellectual sloppiness. He famously declared that computer science is no more about computers than astronomy is about telescopes.

Yet his severity was born of a profound humility. Dijkstra recognized that the human mind is small, frail, and easily overwhelmed by detail. The glory of mathematics was not that it made problems complicated, but that it was the only technique humanity had ever discovered to make impossibly complex things manageable, transparent, and undeniably true. By banishing superstition and intuition from software, Edsger Dijkstra gave the digital age its most precious virtue: the quiet, luminous dignity of provable correctness.


“Computer science is no more about computers than astronomy is about telescopes.”

“Program testing can be used to show the presence of bugs, but never to show their absence!”

“Simplicity is prerequisite for reliability.”

“If debugging is the process of removing software bugs, then programming must be the process of putting them in.”

“The question of whether machines can think is about as relevant as the question of whether submarines can swim.”


  • A Note on Two Problems in Connexion with Graphs (Shortest Path) 1959
  • Cooperating Sequential Processes (Semaphores & Mutex) 1965
  • Go To Statement Considered Harmful 1968
  • The Structure of the 'THE'-Multiprogramming System 1968
  • The Humble Programmer (Turing Award Lecture) 1972
  • Self-stabilizing Systems in Spite of Distributed Control 1974
  • A Discipline of Programming 1976