Programmers call an error a "bug" and call removing it "debugging". Behind these words lies a much-loved story: in 1947 a real moth was found inside a giant computer at Harvard. What's more, that moth is still around, in a museum, taped into a logbook.
The story is true. But it hides two small corrections that social media rarely tells. One is about who found the moth, the other about the age of the word "bug". We can settle both by looking at the primary source, that is, the record of the museum where the moth sits today.
The moth in the relay
The machine where it happened was the Harvard Mark II. This was a huge calculator that ran on electromechanical relays instead of electronic circuits. According to Wikipedia it weighed about 25 short tons (23 tons) and covered more than 370 square meters. An addition took 0.125 seconds and a multiplication 0.75 seconds.
Compared with its predecessor, the Mark I, the Mark II was about 2.6 times faster at addition and about 8 times faster at multiplication. It was the second machine with hardware support for floating-point numbers and had built-in units for operations like square roots and logarithms, each taking 5 to 12 seconds. An interesting design detail was that the machine consisted of two sub-computers that could work together or separately, so results could be cross-checked. It was delivered in March 1948 to the Naval Proving Ground in Dahlgren, Virginia.
On September 9, 1947, at around 3:45 p.m., the machine wasn't working properly, so the team looked inside. According to Computerworld, the moth was stuck between the contacts of relay number 70 on panel F. The team removed the moth and taped it into the machine's logbook. In today's language, the team had literally "debugged" the machine. Next to it they wrote this note: "First actual case of bug being found."
Correction 1: Grace Hopper didn't find the moth
This story is usually told along with the computing pioneer Grace Hopper. Hopper really was working on the Mark II in 1947 and later became a rear admiral in the US Navy. According to Wikipedia, she worked with Howard Aiken and Edmund Berkeley on the machine's construction and programming. But according to the record of the Smithsonian National Museum of American History, those who taped the moth into the logbook were engineers working on the Mark II, and the logbook was "probably not Hopper's."
Hopper's real contribution was making the story famous by telling it for years. The museum says Hopper and the Mark II team helped popularize the terms "computer bug" and "debug".
There's also a small confusion about the date. Some sources, including Computerworld's article, give the date in the logbook as 1945. The Smithsonian dates the logbook to 1947, and the Mark II was only completed in 1947 anyway. So 1947 is the most solid date.
Correction 2: The word "bug" was much older
Read the note again: "first actual case of bug being found." The joke is in the word "actual". Engineers were already calling glitches "bugs". This time, for the first time, they had found a real bug. So the note is really a small but lasting example of engineer humor.
Citing The Yale Book of Quotations, Computerworld reports that in an 1878 letter to Theodore Puskas, Thomas Edison used the word "Bugs" for small faults and difficulties. So the moth didn't invent the word, it just became the nicest proof of it.
| 1947 | Today |
|---|---|
| Bug: a moth stuck in a relay | Bug: a line overlooked in the code |
| Debugging: removing the moth by hand | Debugging: debuggers and tests |
| Fault log: a paper notebook | Fault log: issue-tracking systems |
Why is the story so loved?
Because it makes something abstract tangible. A "software error" is invisible. But a real moth taped into a notebook is a picture everyone understands. And it began as a small joke among engineers and has been told for nearly 80 years.
Few people remember the Mark II's technical specifications today, but everyone knows that moth. In technology history, the smallest things sometimes leave the biggest mark.
Have you ever run into a bug in your code that hid like a real insect?