Margaret Hamilton, the MIT programmer whose teams wrote the onboard flight software that carried Apollo astronauts to the moon and back, has died at 90. MIT announced the death on Wednesday, October 7, saying she died on September 30. The New York Times reports that she died in a hospital in Cambridge, Massachusetts, and that her daughter, Lauren, confirmed it. MIT gave no cause of death, and the portion of the Times report this desk could read gave none either.

Hamilton came to computing almost by accident. Born in Paoli, Indiana, in 1936, she studied mathematics at the University of Michigan and then at Earlham College, where she earned a bachelor’s degree in mathematics with a minor in philosophy in 1958, MIT News says. A year later she moved to Boston with her husband while he studied law, and she took a temporary job in MIT’s meteorology department writing weather-prediction software for Edward Lorenz, whose later work on chaos theory her programs helped inform. In 1961 she moved to MIT’s Lincoln Laboratory to write software for SAGE, the first U.S. air defense system, on a prototype computer the Air Force used to hunt for hostile aircraft. There, MIT says, she grew interested in software reliability, an idea few people had studied.

In 1965, as she prepared for graduate school, her husband spotted a newspaper advertisement: MIT’s Instrumentation Lab wanted people to help “send man to the moon.” The lab, led by the aeronautical engineer Charles Stark Draper, had won NASA’s contract to build Apollo’s guidance software. Hamilton applied and became the project’s first programmer and its first woman programmer, according to MIT. She started on the software for uncrewed flights and then moved up to lead the team building onboard software for the crewed missions.

Accounts of her rank and her team’s size differ. MIT News says that by 1968 she served as assistant director in charge of the Command and Service Module team, while more than 400 people worked on Apollo’s software overall. The Times describes her as leading a 100-person team that wrote the onboard software, and says she rose to director of software engineering. The two counts may describe different groups, and this desk could not settle the difference.

A child helped shape her philosophy. According to MIT, her four-year-old daughter, Lauren, once played with the command module simulator at the lab and triggered a prelaunch program, called P01, while the simulator flew a mission, crashing it. Hamilton wanted a software guard against the same mistake in flight, but managers overruled her, reasoning that trained astronauts would never do it. During the Apollo 8 mission in 1968, astronaut Jim Lovell did exactly that, wiping the spacecraft’s navigation data, MIT says. Hamilton’s team helped recover, and her fix went into the program afterward. MIT calls it an early case of “defensive” programming, software built to expect human error and protect itself from it.

That thinking paid off on July 20, 1969. Minutes before the lunar module Eagle touched down, its computer flashed a 1202 alarm: it had more work than it could handle. The software Hamilton’s teams designed could shed less important tasks and keep the ones the landing needed, and Mission Control let the descent continue. The Times reports that Hamilton, then 32, listened in from MIT, and that the onboard computers held only 72 kilobytes of storage memory. Sources describe the cause a little differently. MIT blames a fault in a hardware switch, while a 2003 NASA release says the crew had switched on a radar system because of a faulty written procedure, and the software overrode a command to give that radar priority. “The error detection and recovery mechanisms had come to the rescue,” Hamilton later said, in a quote the Guardian carried.

Obama recalled the episode when he gave her the Presidential Medal of Freedom in 2016. “Our astronauts didn’t have much time, but thankfully they had Margaret Hamilton,” he said, according to the Guardian. The medal citation, as MIT quotes it, says Hamilton “defined new forms of software engineering and helped launch an industry that would forever change human history.”

She fought for that phrase. Hamilton told the Spanish newspaper El País in 2018 that she started calling her work “software engineering” to give it standing beside hardware and other fields. “I fought to bring the software legitimacy,” she said, as MIT quotes her. “They liked to kid me about my radical ideas. Software eventually and necessarily gained the same respect as any other discipline.” The Times credits her with popularizing the term, a claim that stops short of saying she invented it.

Her recognition arrived slowly. NASA gave her its Exceptional Space Act Award in 2003, and the NASA technologist who nominated her, Paul Curto, said at the time that he felt surprised to find the agency had never formally honored her. Her concepts of asynchronous software, priority scheduling, end-to-end testing, and priority displays “became the foundation for ultra-reliable software design,” Curto said. NASA’s then-administrator, Sean O’Keefe, said the ideas she and her team created “became the building blocks for modern ‘software engineering.’” Later honors included the Computer History Museum Fellow Award in 2017, the Intrepid Lifetime Achievement Award in 2019, and induction into the National Aviation Hall of Fame in 2022, MIT says.

After Apollo, the Instrumentation Lab spun out of MIT and became the independent Draper Laboratory. Hamilton founded her first company, Higher Order Software, in 1976, built on error prevention and fault tolerance, and a decade later started Hamilton Technologies, whose main product, the Universal Systems Language, models complex software systems with the same defensive aims, according to MIT. She wrote more than 130 publications. “Margaret left an indelible mark on Draper,” said the lab’s president and chief executive, Jerry M. Wohletz. “We will honor her legacy at Draper forever.”

In her later years, a 1969 photo of Hamilton standing beside printouts of her MIT team’s Apollo code turned her into an icon for women in science and technology. The Apollo software she helped write went up in full on the code-sharing site GitHub, and in 2017 Lego released a Women of NASA set, designed by MIT science writer Maia Weinstock, that included a Hamilton minifigure. Olivier de Weck, interim head of MIT’s Department of Aeronautics and Astronautics, said she devoted her career to preventing errors and to what she called “handling the unknown.” He added: “She personified leadership by example, and established a practice of software engineering based on problem-solving and systems engineering that we all benefit from.”

Hamilton looked back on the Apollo years with something close to wonder. “We took our work seriously, many of us beginning this journey while still in our 20s,” she told MIT News in 2009. “We had to find a way, and we did.” She leaves her daughter, Lauren Hamilton; her son-in-law, Richard Selesnick; two grandsons; and four great-grandchildren. MIT says a memorial service will take place in Cambridge in the spring.