Software Bug History
From a moth taped into a Navy logbook in 1947 to the bugs
that destroyed satellites
and crashed stock exchanges — one small word with a very large history.
The Origin of “Bug” — Edison, Grace Hopper, and a Very Unfortunate Moth
The word “bug” as engineering slang for a mysterious fault predates the computer by nearly seventy years. In 1878, Thomas Edison wrote in a letter: “…It has been just so in all of my inventions — the first step is an intuition … then difficulties arise — this thing gives out and [it is] then that ‘Bugs’ — as such little faults and difficulties are called — show themselves.” Edison capitalized the word and set it in quotation marks, which is how writers signal borrowed vocabulary. He was documenting a term already circulating among telegraph operators and mechanical engineers — not coining it. The word had been in the air for years; he simply put it on paper.
Then came September 9, 1947. The team working on the Harvard Mark II — an electromechanical relay computer at the U.S. Naval Surface Warfare Center in Dahlgren, Virginia — found their machine producing incorrect results. A technician traced the fault all the way down to Relay #70, Panel F, where a moth had flown in and died, physically jamming the relay contact and disrupting the circuit. The moth was carefully removed, taped into the team’s logbook, and annotated with one of the best lines ever written in an official government document:
“First actual case of bug being found.” — Harvard Mark II Logbook, September 9, 1947 (now at the Smithsonian)
Notice the word “actual.” Not “first case ever.” The team already knew “bug” as established slang for a hardware or software fault. The word “actual” is doing the work: this was the first time a reported bug turned out to be a literal insect. Someone wrote a deliberate pun into a U.S. Navy technical logbook in 1947, and it survived to the Smithsonian. That is a very good joke.
Rear Admiral Grace Hopper was a senior figure on the Mark II project and is most often credited with this story in the popular imagination, though the specific logbook annotation is attributed to her colleague Lieutenant William Burke. Hopper’s contribution came afterward: she told this story in public lectures for decades. She was one of the most gifted communicators the field ever produced — the same person who handed audiences an 11.8-inch piece of wire to give them a physical sense of a nanosecond (the distance light travels in one billion of a second). Her decades of retelling the moth story are largely why it survived as computing’s founding myth rather than a footnote in a Navy logbook.
See Ask Copilot Entry #082 for the full history, including a chronological breakdown of why the word stuck, five reasons engineers never abandoned it, and a cross-reference to two related entries on rubber duck debugging and attention-to-detail bugs.
CS Connection — Why Bugs Matter More Than Errors
There is an important distinction that separates beginners from practitioners: syntax errors are not bugs. A syntax error is a mistake the compiler or interpreter catches before the program ever runs — a missing brace, a misspelled keyword, an unclosed string. The language itself refuses to proceed, and the error message tells you almost exactly where to look. These are annoying, but they are not dangerous.
A bug is a program that runs — and produces the wrong result. The language has no complaint. The computer has no complaint. Only the real world complains. The five classes of bugs that caused the most damage in computing history are each a lesson on their own:
| Bug Class | What Goes Wrong | Famous Example |
|---|---|---|
| Integer Overflow | A value grows larger than its data type can hold; the number wraps or truncates silently. | Ariane 5 (1996) — a 64-bit velocity value overflowed a 16-bit field; a $370M rocket destroyed 37 seconds after launch. |
| Race Condition | Two processes share state; timing determines which one “wins” and corrupts the other. | Therac-25 (1985–87) — a timing-sensitive software defect allowed radiation doses hundreds of times the safe limit; at least six patients died or were severely injured. |
| Units Mismatch | Two components assume different units for the same quantity; conversion is never performed. | Mars Climate Orbiter (1999) — one team sent thruster data in pound-force seconds; another expected Newton-seconds. A $125M spacecraft vanished into Mars’ atmosphere. |
| Off-by-One / Boundary | A loop iterates one too many or too few times; an index goes one past the end of an array. | Patriot Missile (1991) — a floating-point clock drift caused a 0.34-second targeting error; a Scud missile went unintercepted and killed 28 soldiers. |
| Logic / State Error | The algorithm is syntactically correct but semantically wrong; the code does exactly what it says, but what it says is not what the programmer meant. | Knight Capital Group (2012) — a deployment error activated dormant legacy trading code; $440 million was lost in 45 minutes before anyone could intervene. |
The through-line in every case: the program executed perfectly. The compiler never objected. The problem was not the syntax — it was the meaning the programmer attached to the numbers, the units, the timing, the data types. That gap between what the code says and what the world requires is where bugs live. Learning to think about that gap before you write the code, rather than after the satellite disappears, is one of the most important skills in the field.
Movie clips are only available in larger viewports.
On some mobile devices, rotating to landscape will allow viewing.
Clip 1 — TechHistory: The Story of the First Computer Bug
A concise retelling of the September 9, 1947 incident: the Harvard Mark II, the moth in Relay #70, and the Navy logbook entry that gave computing one of its most enduring words. The clip covers Edison’s earlier use of the term and traces the path from mechanical engineering slang to the vocabulary of every programmer who has ever muttered “there’s a bug in my code” at 2 a.m.
Clip 2 — The Worst Software Bugs in History
What happens when a bug escapes testing and meets the real world? This clip surveys the most consequential software defects ever documented: the Ariane 5 integer overflow that vaporized a $370 million rocket, the Therac-25 race condition that turned a radiation therapy machine into a weapon, the Mars Climate Orbiter lost to a metric/imperial units mismatch, and others. Each one demonstrates a class of error that no amount of syntax checking would have caught — because the programs ran flawlessly. They just did the wrong thing.