The story of the world’s first software bug
You’ve probably heard the story about the moth in the logbook at Harvard. This post is about what actually happened.
The Bug: An Early History
Technologic advancement has been plagued with bugs, pretty much ever since there was technology to advance. As early as the 1800s, Thomas Edison referred to issues with his “apparatus” as bugs. And even before that, false signals in telegraphs were also considered bugs.
“You were partly correct, I did find a ‘bug’ in my apparatus, but it was not in the telephone proper. It was of the genus ‘callbellum.’ The insect appears to find conditions for its existence in all call apparatus of telephones” - Thomas Edison in a letter
Not even Edison could resist the “insect vs. tech bug” play on words— which is kind of cool even if it does mean this particular joke is getting very old. In a way, it’s comforting to know that tech nerds in 1878 loved a good dad joke, as much as tech nerds in 2024.
Exhibit A
Bug/insect joke in 1878
Bug/insect joke in 2024
And so dear reader, with that semantic context out of the way, we’re going to jump about 100 years of hardware and mechanical engineering into the future, as we enter ~our computer era~ and with it— the beautiful world of software programming.
The history that’s been collected here, is the fruit of 3 hours of caffeine infused spirals through both Wikipedia and the very niche corners of Reddit you yourself may have haunted.
It is a work of love, and SEO-rich headings, because after all- if you’re here, you might like to know that we’re Jam, a browser extension that automates bug reporting.
But enough about Jam, the bug reporting tool for 1-click bug reports devs love, because this tale deserves to be told in its own right. It is the story of the very first software bug and its subsequent report. And in it a legacy of engineering brilliance and debt.
The truth behind: ”First actual case of a bug being found”
In September of 1947, Grace Hopper was probably mad about the Giants beating the Boston Braves. It was a Tuesday or a Wednesday morning, she got in her car, turned on the radio and sang along to Francis Craig’s “Near You” — a #1 hit that had come out earlier that month, as she made her way to Harvard University where she was a computer scientist.
These are all things known or likely to be true about Grace Hopper in 1947— but here’s one thing she did not do when she got to work: discover the first “computer bug”.
Grace Hopper shaped modern software engineering
She did, however, eventually lay the foundation for modern programming and software development. Hopper developed the first compiler and played a key role in creating COBOL (Common Business-Oriented Language), one of the first high-level programming languages still used today. She was a visionary, who believed that computers would someday become ubiquitous, at a time when a single one took up a full room and a lot of money— then helped to make it so.
In 1947, Hopper was part of a dedicated team working on the Mark II Aiken Relay Calculator at the Harvard Computation Laboratory, on behalf of the U.S. Navy. Their mission? To build advanced computing machinery capable of performing complex calculations at unprecedented speeds, critical for the Navy during World War II. These calculations ranged from ballistics trajectories to code-breaking and logistical planning.
The Mark II, an electromechanical computer and successor to the Mark I, was a beast of engineering. Packed with thousands of relays and switches, it performed tasks that would take human mathematicians ages to complete. Named after its chief designer, Howard Aiken, the Mark II could tackle differential equations, crunch complex logarithms, and solve intricate mathematical problems for naval operations.
How to report a bug in 1947
Imagine Hopper, already annoyed by the latest Boston Braves loss, stepping into the bustling Harvard Computation Laboratory. When the Mark II acted up, she and her team didn’t just file a ticket; they embarked on a hands-on quest. They halted the machine, scrutinized miles of wiring, and manually traced through relays to pinpoint the problem.
Upon finding a bug, they documented every detail in a hefty logbook. This wasn't just a note in Jira; it was a comprehensive record of the issue, steps to locate it, and the fix (sound familiar?). This meticulous approach ensured they could reference and learn from each issue. It was effective, also time-consuming and annoying. That’s probably why the actual bug reporting process hasn’t changed all that much, even if the rest of software has. We have screenshots and issue trackers now, but we’re still writing repro steps.
The future of debugging is auto-included dev tools & automatic steps to reproduce in every bug report.
Grace Hopper did not log the infamous bug report about the moth
That morning, Mark II had a mind of its own, refusing to perform the calculations that had been expertly programmed. The team pored over the labyrinth of wires and relays, until someone did find the world’s first “computer bug”— in a very literal sense. Whoever spotted it made the very first bug report that contained a bug found in a computer: a moth.
At this time, the number of computers in the world could be counted on one hand. We're talking about giants like the ENIAC, which was the first programmable, general-purpose electronic digital computer. This behemoth was a marvel, lighting up the room with its thousands of vacuum tubes and consuming enough power to dim the lights in Philadelphia. So it’s safe to say, even though there weren’t a lot of computers in the world, plenty of logbooks had already been filled with bugs.
That’s the real story. We don’t actually know who found the moth and logged the “first actual case of a bug being found". Although it was the first log of an insect bug causing a software bug, it was not actually the first software bug.
The first software bug happened before software was a real thing in the world
In 1815, the poet Lord Byron, of “Don Juan” fame, had a daughter who would go on to become Ada Lovelace, a mathematical genius and visionary. Lovelace's claim to fame lies in her groundbreaking work with Charles Babbage on his Analytical Engine, a design for a mechanical general-purpose computer—unfortunately, it was never built.
Ada Lovelace, the first programmer?
In the early 1840s, while translating an Italian engineer’s article about Babbage’s machine, Lovelace added her own notes. These notes detailed an algorithm for the Analytical Engine to calculate Bernoulli numbers. This wasn't just a simple calculation; it was a set of instructions for the machine to follow, making it the first computer algorithm designed for a machine.
Essentially, Lovelace wrote the world's first computer program—or one of the firsts. It’s tricky to pinpoint the exact "first" in programming history. Historians and Redditors alike love to debate this. A more accurate view is that she made a monumental contribution to a field that has evolved thanks to countless innovators over the centuries.
Back to the bug, so in this first/early theoretical computer program written by Ada, there was a typo. This typo IS the earliest documented bug in software history. The error involved an incorrect division operation: the program listed v5 / v4
when it should have been v4 / v5
.
But, this bug went unreported— it wasn’t until long after it was originally published in 1843 that modern researchers and programmers caught the world’s first bug.
Reddit jokes aside, Ada Lovelace imagined a machine that could process anything that could be symbolically represented, such as music or art. Can you picture what computers would be like without her?