← Back to the blog

Margaret Hamilton: the engineer who built failure into the design

Margaret Hamilton: the engineer who built failure into the design

20 July 1969. The lunar module Eagle is descending towards the surface of the moon. Seven minutes before touchdown, the guidance computer raises an alarm nobody on board was expecting: 1202.

It will raise it three more times, and once more with the code 1201. The computer was overloaded, and it was saying so.

The landing continued — not in spite of the alarm, but because of how the software had been written.

The woman behind that code

Margaret Hamilton died on 30 September 2026, at a hospital in Cambridge, Massachusetts, aged 90.

She was hired in 1965 as the first programmer on the Apollo project at MIT. By 1968 she was responsible for more than 400 people, and her team wrote the software that ran inside the spacecraft. In 2016 she received the Presidential Medal of Freedom.

Margaret Hamilton in 1969, standing next to a stack of printed listings taller than she is.
In 1969, next to the printed source code of Apollo — that is how code was read then. Photo: Draper Laboratory, restoration by Adam Cuerden.

Back then software wasn't considered engineering at all — it was considered something done on the margins of the real work, which was the hardware. In her own words:

"I fought to bring the software legitimacy so that it — and those building it — would be given its due respect, and thus I began to use the term software engineering."

The term that now appears on millions of CVs started as an argument.

The four-year-old who found the bug

Before the Apollo 8 flight she was working on the simulator with her four-year-old daughter Lauren there with her. The child pressed keys and started P01, a pre-launch program that had no business running mid-flight. The simulator crashed.

She asked for protection to be added to the code. The answer was that astronauts are trained and don't make mistakes like that.

On the actual mission, Jim Lovell started P01 by accident. The navigation data was wiped. Her team fixed it, and the changes she had asked for went into the code after all.

Why the Eagle landed

Back to 1202. A radar switch was in a position that caused the radar to steal processor time, and the computer couldn't keep up.

The software didn't hang. It threw away the low-priority work, restarted from a point it knew was safe, and kept alive only what was needed to land the spacecraft.

The asynchronous executive was designed by J. Halcombe Laning; what Hamilton's team added was the error detection and recovery. That is: the assumption, written into the code itself, that at some point something will go wrong.

On the computer's panel there was a light that read RESTART. It wasn't a fault. It was a feature.

The display and keyboard unit (DSKY) of the Apollo Guidance Computer, showing the RESTART and OPR ERR warning lights.
The DSKY, the unit through which the crew saw the computer. On the left, among the lights: RESTART and OPR ERR. Photo: NASA / Dennis Taylor.

What remains

None of that code runs anywhere today. What remains is the idea.

Every retry with backoff, every timeout, every transaction that rolls back, every system that degrades instead of dying — they all start from the same assumption: that the system will end up in a state nobody planned for, and that handling it is the code's job, not something the user has to avoid.

In 1968 that sounded like overkill. Today it is simply called good practice.

When Hamilton said "a person will press the wrong button", she was told they wouldn't. They did.

The difference between code that holds and code that merely works is usually someone who insisted on an objection like that when nobody wanted to hear it.


Sources: MIT News obituary (7 October 2026); Wikipedia, Margaret Hamilton (software engineer). Timings from the Apollo 11 flight journal: first alarm at 102:38:26, touchdown at 102:45:40. Photos: NASA, public domain, and Draper Laboratory.