DEV Community

fluidwire
fluidwire

Posted on • Originally published at fluidwire.com

The First Computer Bug Was a Real Moth

Every developer who has ever muttered "there is a bug in this" is repeating a word with a surprisingly literal origin. On September 9, 1947, the operators of the Harvard Mark II, an early electromechanical computer, traced a malfunction to its source and found something they did not expect: a moth wedged inside Relay #70. They removed the insect, taped it into the operations logbook, and wrote a now-famous line beside it: "First actual case of bug being found." That page, moth and all, survives today in the collection of the Smithsonian's National Museum of American History.

It is one of the best-loved stories in computing, and like most good stories it is a little more complicated than the popular version. Worth getting right, because the discipline it gave us is the same one behind every connected device we build.

What actually happened in 1947

The Mark II was a room-sized machine built from relays, switches, and thousands of moving parts. When a moth flew into one of those relays, it physically interfered with the contacts and caused a fault. The technicians who found it had a sense of humor: calling it the "first actual case of bug being found" was a joke precisely because engineers had already been using "bug" for years to describe mysterious faults in machinery. Thomas Edison used the term in his notebooks back in the 1870s.

So the 1947 moth did not invent the word "bug." What it did was give the term a perfect, photographable origin story, and it cemented the companion word that really matters: debugging. The act of removing that moth was, quite literally, de-bugging the computer.

The Grace Hopper connection

The story is almost always told with Grace Hopper at its center, and that deserves a small correction. Hopper, a pioneering computer scientist who later helped develop COBOL, was part of the Mark II team in 1947, but the evidence suggests she did not personally find the moth or write the logbook entry. What she did do was tell the story, brilliantly and often, for the next four decades. Her retelling is the reason the moth became famous and the reason "debugging" entered everyday engineering vocabulary. It is a useful reminder that the people who explain ideas clearly often shape a field as much as the people who discover them.

Why a 78-year-old moth still matters

Hardware has changed beyond recognition since 1947. A modern ESP32 microcontroller fits on a fingertip and outperforms that entire room of relays by orders of magnitude. What has not changed at all is the core activity of finding the one small thing breaking the whole system.

In modern IoT and embedded development, debugging is the work. A sensor returns garbage values and you have to decide whether the fault is in the wiring, the I2C address, the firmware, or the sensor itself. A device connects to Wi-Fi perfectly on the bench and then drops offline once a day in the field. A board behaves flawlessly until it gets warm. None of these announce themselves with a convenient moth taped to a relay. The engineer's job is to reproduce the fault, isolate it, and prove the fix, exactly as those Harvard technicians did with a pair of tweezers and a logbook.

That methodical mindset is the unglamorous skill that separates a prototype that works in a demo from a product that survives in the real world. It is the difference between a thesis project that runs once for the panel and a connected device a business can actually deploy.

Debugging is the real craft

At Fluidwire, debugging is a large part of what we do every day, whether we are bringing up a new PCB, chasing an intermittent fault in connected-device firmware, or helping a student in Parañaque get a stubborn sensor to behave before a thesis deadline. The tools are better than they were in 1947, but the patience and the systematic thinking are identical.

If you are building an IoT or embedded project and you are stuck on a fault you cannot pin down, that is a normal and necessary stage of engineering, not a sign you are doing it wrong. Every working device on earth was buggy first. If you would like a hand finding your moth, get in touch with our team and tell us what is misbehaving.

The next time your code throws an error, remember that you are part of a tradition going back to a single insect in a Harvard relay. Find the bug, log the fix, and ship it. Learn more about how we build connected hardware from silicon to cloud at fluidwire.com.

Top comments (0)