Before Computer Science Became a Boys' Club, Margaret Hamilton Wrote the Code
The woman who programmed the Apollo spacecraft died at 90, leaving behind a legacy that helped shape modern software engineering.
Margaret Hamilton was a pioneer in computer science who wrote the software that guided Apollo spacecraft to the moon in the 1960s. She led a team at MIT and helped make space travel possible through her careful and creative programming. Hamilton died last week at the age of 90. For many years, most people had no idea who she was or how important her work had been. Today, she is recognized as one of the most important figures in the history of technology.
Hamilton's male colleagues used to tease her about her focus on software engineering. At the time, building physical hardware was seen as far more important and impressive. Hamilton believed software deserved just as much respect as hardware, but most people treated that idea like a joke. It took years before anyone truly listened to her ideas. Even then, she recalled, it was only when a male colleague agreed with her that others started to pay attention.
Hamilton was not the only woman to shape computing before it became a high-paying career. In the 1840s, Ada Lovelace wrote what is considered the first computer program, even before computers existed. During World War II, six women called the ENIAC Six programmed one of the first electronic digital computers. In the 1950s, Grace Hopper invented a tool called a compiler, which translated human-friendly language into instructions a computer could follow. Women also worked as human computers in the early space program, doing complex math by hand.
For the Apollo program, Hamilton led the software team at MIT, which had won the contract to program the spacecraft's computers. Her team's most important job was making sure the software was safe enough for human lives to depend on it. She always kept that responsibility at the front of her mind. The software had to work perfectly the very first time it was used in space. 'If it didn't work, a person's life was at stake -- if not over,' she said.
Hamilton even helped find an important software fix thanks to her young daughter, Lauren. Lauren would visit the lab on nights and weekends and pretend to be an astronaut, pressing buttons on the spacecraft simulator. One day, Lauren accidentally caused a simulation to crash by pressing the wrong button. This revealed what the team called the Lauren bug. Hamilton wanted to fix it, but her bosses said trained astronauts would never make that same mistake.
Hamilton pushed back, asking what would happen if an astronaut did press the wrong button by accident. Her careful thinking paid off when, during the Apollo 8 mission, an astronaut pressed that exact button during actual flight. After that, Hamilton was finally allowed to add the fix to the software. This kind of what-if thinking was central to how she approached her work. She always prepared for things that might go wrong, even when others thought the risk was too small to worry about.
That careful planning proved critical during the Apollo 11 moon landing in 1969. As Neil Armstrong guided the lunar lander toward the surface, a series of warning alarms went off. Hamilton's team had already predicted that the small onboard computer might get overloaded with too much data during landing. Because of their planning, the computer was built to drop less important tasks and keep running the ones that mattered most. The landing succeeded, and Hamilton's software was a key reason why.
Even though her work was essential, Hamilton went largely unrecognized for decades after Apollo. It was a famous photo — Hamilton grinning next to a tall stack of printed code — that finally brought her wide attention years later. In 2017, Lego recreated that image in a Women of NASA building set, introducing her to a whole new generation. The New York Times had not even mentioned her name until 2005. She had become a hidden figure in one of history's greatest achievements.
Hamilton also noticed that the culture around computer science changed over the years, and not always for the better. In 1984, women made up 37 percent of computer science college majors, but that number fell sharply in the following decades. As personal computers became popular, the field started to feel like a hobby mostly for boys, and women began to leave. 'I was surprised that it almost seemed to be worse in some ways today than it was back in the early days,' Hamilton said in 2017. The percentage of women in computer science dropped below 20 percent before nudging back up only slightly.
During her career, Hamilton was sometimes asked how she could work while also raising a child. She answered simply that everyone has to do what is right for them. She said she was so focused on solving hard technical problems that she did not always notice she was surrounded mostly by men. 'We concentrated on our work more than whether one was male or female,' she said. Even so, she believed gender discrimination never truly disappeared — it only became more hidden over time, making it harder to see and harder to fight.
"If it didn't work, a person's life was at stake -- if not over."
Comprehension quiz preview
1. What was Margaret Hamilton's job at MIT during the Apollo program?
2. What did Hamilton's daughter Lauren accidentally cause at the lab?
3. What percentage of computer science college majors were women at the peak year of 1984?