Margaret Hamilton and Apollo 11

margaret hamilton .jpg

The Apollo 11 landing came close to never happening. Shortly before touching down on the Moon, the Eagle's onboard computer fell behind in its real-time navigation calculations. The result could have been a disaster except that the software was clever enough to recover from a user error.

Today that sort of capability is routine, but in 1969, long before programming schools and coding bootcamps. it was cutting-edge technology on a computer whose memory was measured in kilobytes. The head of the software team that made it possible was Margaret Hamilton.

The Apollo software development project

The Apollo program required major advances in computer technology. It needed an on-board computer at a time when most computers filled large rooms and weighed tons. The Apollo Guidance Computer, developed by Raytheon, was in a box six inches by one foot by two feet and weighed 70 pounds. One of these computers was in the Command Module, which stayed in orbit around the Moon, and the other was in the Lunar Module, which landed on the surface.

The software development team worked at MIT's Instrumentation Laboratories, known on campus as the "I-Labs." Women were a minority among computer programmers in the sixties, just as they are today, but Hamilton excelled so much that she put in charge of the project. The software had to be perfect. It had to work the first time it was deployed in the field. As she said later, "There was no second chance."

There was no precedent for what they accomplished. They had no coding school to tell them how to program a minicomputer to land 240,000 miles from Earth. They didn't learn to code —they had to develop coding techniques for the first time, many of which are still used today.

The source code was written in a low-level assembly or macro language, very close to the raw machine instructions. Higher-level languages like Fortran existed, but they were a luxury that the developers couldn't afford while getting the maximum performance out of a minimalist computer.

Drama in space

On July 20, 1969, a couple of minutes before the Apollo 11 Lunar Module was due to land, the computer issued a "1202 alarm." This was the wrong time for anything to go wrong. Neil Armstrong asked ground control in Houston what it meant. A software engineer decided it didn't call for aborting the landing and had Houston tell the astronauts to continue. This was the right call, and Armstrong shortly announced that "the Eagle has landed."

The problem turned out to be a user error. The Rendezvous Radar Switch had been set in the "auto" position instead of "manual," which made it use up valuable computer cycles. The 1202 code signified that the software recognized it was falling behind in its navigation calculations, and it had compensated by shutting off all other tasks. This let it conduct the landing safely.

Hamilton's team had recognized that the computer had multiple tasks to do, and that it could easily be pushed to the limits of its processing ability. Preventing a failure under these circumstances meant adjusting task priorities in response to real-time conditions. This was a huge accomplishment in both foresight and design. Without that capability, Apollo 11 would have had to return without landing, or it might have crashed.

Here's the code that did it. Yes, it's hard to read. You need to understand the computer's architecture to follow it properly.


On September 3, NASA honored Hamilton with an Exceptional Space Act Award for her achievements. NASA Administrator Sean O'Keefe said, "The concepts she and her team created became the building blocks for modern 'software engineering.'" The term "software engineering," incidentally, was her coinage. On November 22, 2016, President Obama awarded her the Presidential Medal of Freedom, which is the United States' highest civilian award.

The Apollo 11 Moon landing was one of the most memorable moments of 20th-century history, and Margaret Hamilton's code made it possible.

Today you have one advantage that Hamilton didn't: You can learn to code at our coding bootcamp in the Denver area. You'll not only learn the skills but get a chance to apply them on a real-world project. Contact us to learn more.

Jan Wagner

Powered by Top Rated Local® --------------------------------------------------->