Introduction
"I guess I should delay graduate school again because I’d like to work on this program that puts all these men on the Moon." When she made that decision, little did Margaret Hamilton know what was in store for her.
It’s undeniable, though, that she certainly had the mathematical knowledge and determination necessary to prevent major problems from occurring during the Apollo 8 mission (the manned spaceflight responsible for the first orbit around the Moon) and Apollo 11 (the flight that landed on the Moon). Not only that, but she was also the person responsible for creating the term "software engineer," which would describe her occupation and that of many who came after her. So, without further ado, let’s take off and explore her journey.
In our Women in Tech series, we celebrate various visionaries whose work and contributions are frequently overlooked. It’s common to see women’s work in the technology field go unrecognized, unfortunately.
Therefore, in this blog post, we highlight the backstory of a programmer who made critical contributions to important space missions, focusing on error and bug prevention. Let’s learn more about Margaret Hamilton.
Navigation
- Introduction
- A Mathematician who loves the abstract
- Margaret’s coding journey to the Moon
- Conclusion
- References
A Mathematician who loves the abstract
Beloved programmer Margaret Hamilton was born before World War II and was the daughter of teachers. She was born in Paoli, Indiana, in 1936. Her family wasn’t wealthy, in fact, there were 4 children in the household, and Margaret started working from an early age, around 14 years old.
Source: Hack the Moon Margaret Hamilton | Hack the Moon
Her father studied philosophy and poetry, and Margaret often had great conversations with him. Later, she mentioned how discussing various "What-ifs" with him may have helped her anticipate problems that could come up when coding.
But she also made time for fun! In her youth, she was a young woman with many hobbies, like horse riding and playing baseball (being the only girl on her small town’s team), for example.
Throughout her school years, Margaret always had a stronger appreciation for mathematics, like geometry and algebra, even though she enjoyed other subjects too.
I liked the abstract side of mathematics which was always the case. So instead of memorizing things, I liked to derive things. Even when I had an exam, people would memorize them. I would always feel safe because I could derive it to get the answer. (Margaret, 2017)
Taken from Oral History of Margaret Hamilton from CHN.
As the years went by and she approached the end of high school, Margaret wanted to do something interesting, but that could also support her financially. She didn’t want to go to an all-girls college, as was common at the time, because she wanted to have a realistic experience of the world and the job market.
With that in mind, she initially went to the University of Michigan. There, she had several experiences, including having to memorize an entire glossary for a sociology exam because she had spent other nights studying for math exams. We’ve all been there, right? This led the sociology department to call Margaret Hamilton and ask if she would consider majoring in sociology, something she mentioned was very memorable for her.
However, she stayed at that university for only one semester and transferred to Earlham [Earlham College], an institution that had previously been attended by her grandparents, her mother, and her aunt. There, Margaret met her husband and graduated in 1958. And in 1959, she had her daughter.
Margaret Hamilton at work. Source: Hack the Moon Margaret Hamilton | Hack the Moon
Margaret’s coding journey to the Moon
When my husband was in law school, they wanted the law wives… to pour tea. And I said to my husband: no way am I pouring tea… and he was very proud of me, that I had taken that stand. (Margaret, 2017)
Taken from Margaret Hamilton, NASA’s First Software Engineer Video.
As seen above, instead of serving tea, Margaret Hamilton focused on her coding studies, gaining experience with different systems.
One of them was a weather prediction system, she worked for Edward N. Lorenz, professor of meteorology, the father of Chaos Theory. There, she learned a lot about hexadecimal and binary.
And while her daughter was still a baby, Margaret worked nights programming on Project MAC, as part of her work for Lorenz, trying to manage taking care of her family and work life.
Over time, Margaret gained more and more experience with various systems and coding. This made her a formidable software engineer who also began to see patterns:
And after I’d been on two or three computers, I said, "You’ve seen one language, you’ve seen them all." Meaning I could just see what’s the difference. Yeah, you had to learn the syntax but not the semantics, right. (Margaret, 2017)
Taken from Oral History of Margaret Hamilton from CHN.
Finally, while working at Lincoln Labs, she learned about the Apollo Program. From that situation came the famous phrase "I guess I should delay graduate school again because I’d like to work on this program that puts all these men on the Moon."
After completing the interviews, she had two people offering her a job. At the time, she was undecided and asked them to flip a coin to decide. Keep in mind that one of these options was to work with onboard flight software! In the end, as we know today:
And they flipped a coin. And the one that won was the right one. (Margaret, 2017)
Taken from Oral History of Margaret Hamilton from CHN.
On Apollo, still concerned with "What ifs," Margaret developed a program called "forget it," which would serve as a contingency in case problems arose. She also created the concept of offline versions (temp versions) in that system and was known for formalizing the profession’s name as software engineer. In addition to contributing to various flight simulations to test the software, she certainly was a vital programmer in those projects.
Margaret Hamilton received a Medal of Freedom from Obama in 2016. Source: Wikipedia File:Hamilton Medal of Freedom from Obama.jpg
During Apollo 8, for example, Margaret wrote code that would serve as a contingency in case any human error occurred (an error discovered while her daughter was playing astronaut at Margaret’s work):
…they didn’t want to put that in because they were worried about extra code, and the astronauts would “never, ever make a mistake,” quote, unquote. So I remember arguing and saying, “But we all make mistakes. Even astronauts could make a mistake.” (Margaret, 2017)
Taken from Oral History of Margaret Hamilton from CHN.
The changes made to the code by Margaret Hamilton also helped Apollo 11, which suffered a human error that, fortunately, was resolved thanks to Margaret’s and the team’s preparation.
Margaret Hamilton inside the command module simulator. Source: Hack the Moon Margaret Hamilton | Hack the Moon
Conclusion
Margaret Hamilton is a skilled mathematician who wasn’t afraid to worry about error cases.
Preparation in high-risk situations, such as spacecraft takeoff and flight, is essential. And much can be learned from her in modern times. In fact, an excellent talk given by her is available on YouTube, mentioning her journey, how to handle errors, and more about the software used in the Apollo project.
Source: Oral History of Margaret Hamilton from CHN.
We can all benefit from thinking outside the box and handling error cases using various patterns that allow us to provide a better user experience, just as Margaret did. Being an inspiration to many.
Even in an era controlled mainly by men, Margaret didn’t let herself be swayed by pressure and continued contributing with her code in the best way she knew how.
Every single one of those things impacts our culture or impacts women or minorities as to whether they can even do something or not, ‘cause kids might think, well, I can’t do that because I’m this or I’m that. Until we start making changes (Margaret, 2017)
Taken from Oral History of Margaret Hamilton from CHN.
References
- https://www.britannica.com/biography/Margaret-Hamilton-American-computer-scientist
- https://science.nasa.gov/people/margaret-hamilton/#hds-sidebar-nav-1
- Interview: https://youtu.be/6bVRytYSTEk
- https://youtu.be/kTn56jJW4zY
- https://youtu.be/ZbVOF0Uk5lU
- https://wehackthemoon.com
We want to work with you. Check out our Services page!

