Humans in Tech: Margaret Hamilton and the Code Behind Apollo 11

By EVERNET Consulting · · 10 min read

The Earth seen from the surface of the Moon, with stars in a black sky

It is July 20, 1969, and the lunar module Eagle is a few minutes from touching down on the Moon. Then the guidance computer starts flashing alarm codes nobody on the crew has seen in flight before: 1202, then 1201. In Houston, the flight controllers have seconds to decide whether to abort the landing or keep going.

They kept going, in large part because of software built by a team led by Margaret Hamilton at MIT. This profile, part of our Humans in Tech series, covers who Margaret Hamilton is, what she built for Apollo, how she helped turn “software engineering” into a real discipline, and the lessons about testing and error handling that any business can put to work this week.

Who is Margaret Hamilton?

Margaret Hamilton is an American computer scientist and mathematician. She led the Software Engineering Division at MIT’s Instrumentation Laboratory (now Draper), the group that developed the on-board flight software for NASA’s Apollo missions, including the Apollo 11 Moon landing.

She is also widely credited with coining the term “software engineering.” At the time, many people saw programming as a side task, something less serious than building rockets or circuits. Hamilton pushed back on that idea for her entire career.

One quick note, because search results mix them up: this is not the actress Margaret Hamilton who played the Wicked Witch of the West in The Wizard of Oz (1939). Two different women, two very different kinds of fame.

From weather software to the space race

Hamilton was born Margaret Heafield on August 17, 1936, in Paoli, Indiana. She earned a bachelor’s degree in mathematics, with a minor in philosophy, from Earlham College in 1958.

Her first big programming job came in 1959 at MIT, where she wrote weather-prediction software for Edward Lorenz, the scientist later known for his work on chaos theory. She planned to go on to graduate school in math. Instead, she kept getting pulled toward harder programming problems.

In the early 1960s she moved to MIT Lincoln Laboratory to work on SAGE, the Semi-Automatic Ground Environment. SAGE was a Cold War air-defense system that tracked possible enemy aircraft in real time. Writing code for a system where failure was not an option turned out to be good training for what came next.

Joining the Apollo effort

MIT’s Instrumentation Laboratory received the first major Apollo contract from NASA on August 9, 1961, to build the guidance and navigation system. Hamilton joined the lab’s software effort and eventually led the division responsible for the flight software that ran on the command module and the lunar module.

There was no textbook for this work. Nobody had written software that had to fly people to another world and bring them home, on a computer with a tiny fraction of the memory in a modern phone. The team had to invent many of its methods as it went.

Margaret Hamilton and the Apollo software

What set Margaret Hamilton apart was the way she thought about errors. She did not treat them as bad luck to be cleaned up afterward. She treated them as something to study, predict and design around before launch.

MIT has described her contributions as including “asynchronous software, priority scheduling and priority displays, and human-in-the-loop decision capability.” In plain English, that means:

  • Asynchronous software: the computer could juggle many jobs at once instead of running them strictly one after another.
  • Priority scheduling: the most important jobs, like steering the spacecraft, always came first when the computer got busy.
  • Priority displays: the software could interrupt the astronauts’ normal screens to tell them about a problem that needed attention.
  • Human-in-the-loop decisions: when something unusual happened, the system gave people the information they needed to make the call.

The “Lauren bug”

One of the best-known stories from her Apollo years involves her young daughter, Lauren. Hamilton sometimes brought Lauren to the lab, and one day the four-year-old was pressing keys on the simulator and managed to launch a pre-launch program, called P01, while a simulated mission was already in flight. The simulation crashed.

Hamilton wanted to add code to protect against that mistake. The answer she got, as she later told MIT Technology Review, was that astronauts were trained not to make that kind of error, so the fix was not needed. She was allowed to add a note to the documentation instead.

Then, during Apollo 8, a crew member made exactly that mistake, and important navigation data was wiped from the computer. NASA turned to Hamilton to help recover it. After that, the protection went in. Hamilton’s reaction, in her words: “It’s the Lauren bug!”

Giving software a name

Hamilton started calling her team’s work “software engineering” to give it the same respect as the hardware side. The phrase drew some laughs at first. Over time, it stuck, and today it names an entire profession. For Hamilton, the name was the point: if software can decide whether a mission succeeds, it deserves the same discipline, testing and review as any other part of the machine.

The 1202 alarms: what happened during the Apollo 11 landing

Back to that July afternoon. According to NASA’s Apollo 11 Lunar Surface Journal, the program alarms came from a setting of the rendezvous radar switches that caused the computer to keep scheduling extra jobs to process radar data. Those jobs were not needed for the landing, but they took up space. When the computer ran short of the memory areas it used to track work, it raised the 1202 and 1201 alarms.

Here is the important part. Instead of freezing, the software did what it had been designed to do. It restarted, cleared out the extra work, and picked the critical landing tasks back up near where they had left off. It did not restart the unneeded radar jobs. The landing guidance kept running.

Mission control could say “go” with confidence because MIT had tested that restart capability extensively ahead of time. The team had not just written recovery code. They had proven it worked. A few minutes later, Neil Armstrong and Buzz Aldrin were on the Moon.

If you want to read the technical account yourself, NASA keeps it online in the Apollo 11 Lunar Surface Journal program alarms page. The Apollo guidance code itself has since been published online, and one of its files carries a header that reads “SUBMITTED: MARGARET H. HAMILTON DATE: 28 MAR 69.”

After Apollo: companies, awards and recognition

Hamilton did not stop at the Moon. She spent the next decades working on a question that grew out of Apollo: how do you design systems so that whole classes of errors can’t happen in the first place?

Some highlights from her career after the Apollo years:

  • 1976: co-founded Higher Order Software with Saydean Zeldin, building on ideas from the Apollo work.
  • 1986: founded Hamilton Technologies in Cambridge, Massachusetts, around her Universal Systems Language.
  • 2003: received NASA’s Exceptional Space Act Award.
  • 2016: received the Presidential Medal of Freedom from President Barack Obama on November 22, 2016.
  • 2017: named a Computer History Museum Fellow, and featured in the LEGO “Women of NASA” set.

When she received the Medal of Freedom, MIT News described her as the woman who led the development of the on-board flight software for the Apollo missions. It was a public thank-you that came decades after the work itself, for a field that barely had a name when she started.

What Margaret Hamilton teaches businesses about testing and error handling

You probably aren’t landing anything on the Moon this quarter. But the systems your business runs on, your email, your files, your accounting software, your website, fail in the same basic ways Apollo’s could have. People press the wrong button. Something unexpected eats up resources. A recovery plan exists on paper but has never been tried.

A woman software developer points at lines of code on her computer monitor

Plan for the mistake people say won’t happen

The Lauren bug is the lesson in one story. “Our staff would never click that” is the modern version of “astronauts are trained not to do that.” People are busy, tired and human. Good systems expect that. Tools like multi-factor authentication exist for exactly this reason: they assume a password will eventually be guessed, phished or reused, and they add a second check so one slip doesn’t become a breach.

Decide what must keep running

Apollo’s computer knew which jobs mattered most when things got tight. Does your business? If your internet goes down, your server fails or a ransomware attack locks files, which systems have to come back first? Writing that list down ahead of time is the heart of a continuity plan. Our guide to business continuity vs disaster recovery walks through how to think about it.

Test the recovery, not just the feature

Mission control trusted the restarts because they had been tested over and over. Plenty of businesses have backups they have never tried to restore. A backup you haven’t tested is a hope, not a plan. Run a real restore of a real file, and time how long it takes.

Tell people clearly what’s going on

Hamilton’s priority displays interrupted the crew with the information they needed, when they needed it. In an office, that means monitoring and alerts that reach the right person, in plain language, instead of a wall of warnings nobody reads. It also means your team knows who to call when something looks wrong.

Treat IT as engineering, not an afterthought

Hamilton fought to have software taken seriously. The same shift helps small and mid-sized businesses. Documented systems, change reviews and regular testing are what separate “it usually works” from “we know it works.”

A simple error-handling checklist for your business

Here is a short routine, inspired by the Apollo approach, that you can run once a quarter. It doesn’t need special tools, just an hour and the right people in the room.

  1. List your critical systems. Write down the handful of tools your business can’t operate without, in priority order.
  2. Ask “what if someone presses the wrong button?” For each system, name one likely human mistake and what currently stops it from doing damage.
  3. Restore something from backup. Pick a file, a mailbox or a whole machine and actually bring it back. Note how long it took and what went wrong.
  4. Check your alerts. Confirm that warnings about failed backups, full disks or suspicious sign-ins reach a real person who knows what to do.
  5. Review access and sign-ins. Make sure multi-factor authentication is on for email and remote access, and remove accounts for people who have left.
  6. Write down what you learned. Like Hamilton’s program notes, a short record of known risks keeps the next person from rediscovering them the hard way.

Try this today: Pick the one system your business would miss most if it disappeared tomorrow. Ask who would notice first, how they would find out, and how long it would take to get it back. If nobody knows the answer, that’s your first project.

If you already work with an IT partner, bring this checklist to your next review. If you have an internal IT person who is stretched thin, a co-managed IT arrangement can take the testing and monitoring work off their plate while they stay in charge of day-to-day decisions.

Frequently asked questions

What did Margaret Hamilton do for Apollo 11?

Margaret Hamilton led the MIT team that developed the on-board flight software for the Apollo missions, including Apollo 11. Her team’s software design let the guidance computer restart and focus on the most important landing tasks when 1202 and 1201 alarms appeared during the descent, so the landing could continue.

Did Margaret Hamilton coin the term “software engineering”?

Yes, she is widely credited with coining the term during the Apollo program. She used it to argue that building software deserved the same rigor and respect as other engineering fields. The phrase was met with some laughter at first, and it now names a global profession.

Is Margaret Hamilton the software engineer the same person as the Wizard of Oz actress?

No. The actress Margaret Hamilton played the Wicked Witch of the West in The Wizard of Oz (1939). The software engineer Margaret Hamilton, born Margaret Heafield in 1936, is a different person who led the Apollo flight software work at MIT.

What awards has Margaret Hamilton received?

Her honors include NASA’s Exceptional Space Act Award in 2003 and the Presidential Medal of Freedom, presented by President Barack Obama on November 22, 2016. She was also named a Computer History Museum Fellow in 2017, the same year LEGO featured her in its “Women of NASA” set.

What can businesses learn from Margaret Hamilton?

The biggest lesson is to design for human error and test your recovery before you need it. Decide which systems must keep running first, make sure alerts reach a real person, and actually restore from backup on a regular schedule. Those habits turn a bad day into a manageable one.

Building IT that expects the unexpected

Margaret Hamilton’s story is about a person who refused to assume things would go right. She asked what could go wrong, built for it and tested it until she trusted it. That mindset is just as useful for a 20-person office in Connecticut as it was for a spacecraft.

EVERNET Consulting has been a managed service provider since 2007, and today we also provide cybersecurity alongside our IT work. We can run your IT fully managed, or co-managed alongside your in-house team. If you’d like help putting testing, monitoring and recovery plans in place, explore our managed IT services and cybersecurity services, or schedule a call with EVERNET to talk it through.

Let’s talk about what comes next.

Bring the challenge. We’ll help you explore the right scope and a practical next step.