83

The image below is widely circulated on Facebook:

enter image description here

The caption says:

Margaret Hamilton, lead software engineer of the Apollo Project, stands next to the code she wrote by hand and that was used to take humanity to the moon. [1969]

Is it true that:

  1. The photo depicts Margaret Hamilton
  2. Margaret Hamilton was the lead software engineer of the Apollo Project
  3. Depicted is a print-out of the Apollo Project code
  4. Margaret Hamilton wrote the depicted code by hand
  5. Margaret Hamilton single-handedly wrote the code
JonathanReez
  • 10,917
  • 11
  • 51
  • 102
  • 5
    related: http://skeptics.stackexchange.com/questions/28645/was-this-pile-of-code-written-by-a-single-team-of-software-engineers/28657#28657 – Sklivvz Jan 29 '16 at 13:22
  • 2
    @Sklivvz Related but closed... since I couldn't convince people to reopen it, I posted the question on Quora: https://www.quora.com/Was-this-pile-of-code-written-by-a-single-team-of-software-engineers?share=1 – Franck Dernoncourt Jan 29 '16 at 14:42
  • 1
    Dunno about NASA, but when I cooped at Wright-Patterson AFB ca 1970 we wrote code out on coding forms and had it turned into punched cards by keypunch operators. Or we keypunched it ourselves. – Daniel R Hicks Jul 18 '20 at 12:20
  • 1
    The code is now on GitHub, [https://github.com/chrislgarry/Apollo-11](https://github.com/chrislgarry/Apollo-11). The markdown file shown on the front page includes: _Submitted by: Margaret H. Hamilton. Role: Colossus Programming Leader, Apollo Guidance and Navigation. Date: 28 Mar 69._ – Jeppe Stig Nielsen Aug 09 '22 at 08:26

3 Answers3

82

The photo depicts Margaret Hamilton

Yes, this is an official NASA picture of her:

Hamilton

Margaret Hamilton was the lead software engineer of the Apollo Project

Indeed, from the same source:

Margaret Hamilton, leader of the team that developed the flight software for the agency's Apollo missions [...]

Depicted is a print-out of the Apollo Project code

Yes, she says so herself in a Vox interview:

"In this picture, I am standing next to listings of the actual Apollo Guidance Computer (AGC) source code," Hamilton says in an email. "To clarify, there are no other kinds of printouts, like debugging printouts, or logs, or what have you, in the picture."

The source code is here (pdf scans) and there are about 11,000 pages, which is not inconsistent with what we see on in the picture: the paper is likely continuous stationery and 11,000 pages of that are 165cm tall, since a box of 2,000 is about 30cm (ref).

Margaret Hamilton wrote the depicted code by hand

It's unclear what it means:

  1. Is the code in the pile handwritten? No, it's printed with a typewriter or a daisy printer -- see the scans.

  2. Was it written by her in rope core memory? No, it was written in core rope memory by hand by a team according to her interview on Vox:

    The process of actually coding in the programs was laborious, as well. The guidance computer used something known as "core rope memory": wires were roped through metal cores in a particular way to store code in binary. "If the wire goes through the core, it represents a one," Hamilton explained in the documentary Moon Machines. "And around the core it represents a zero." The programs were woven together by hand in factories. And because the factory workers were mostly women, core rope memory became known by engineers as "LOL memory," LOL standing for "little old lady."

Margaret Hamilton single-handedly wrote the code

No. Vox says so, but doesn't cite the source:

It's just her and her code.

NASA contradicts this by saying that it was a whole team lead by her, which seems entirely more likely:

The Apollo flight software Ms. Hamilton and her team developed was truly a pioneering effort

Sklivvz
  • 78,578
  • 29
  • 321
  • 428
  • 8
    Paper thickness commenters: move to [chat] :-) – Sklivvz Jan 29 '16 at 14:09
  • the comment was "I think the "by hand" part is related to writing the code that was later transfered to Apollo. Therefore the question is if Margaret used a computer to write the code or a pen-and-paper/type machine?" and is answered by looking at the scans which are linked. They are written with a daisy printer. – Sklivvz Jan 29 '16 at 15:43
  • 2
    @Sklivvz: Vox also clarifies the last question in the page you mention: "Here's an amazing picture of her next to the code *she and her colleagues* wrote for the ..." – Racso Jan 29 '16 at 15:59
  • 18
    Wow, this answer was great right up until the core rope memory nonsense. The code was *shipped* on rope memory, but it sure wasn't written that way. – Russell Borogove Jan 29 '16 at 17:05
  • @RussellBorogove see if it's better now – Sklivvz Jan 29 '16 at 18:29
  • @user568458 see the edited version – Sklivvz Jan 29 '16 at 18:30
  • 5
    No better. One simply does not "code" or "write" in core rope. The journalist is confused. – Russell Borogove Jan 29 '16 at 18:47
  • 1
    @RussellBorogove I'm not sure what your complaint is. It seems there are two possible interpretations of "written", both of which had to happen at some point (writing the code logic, then physically encoding it into the core rope memory), and both of which are (now) explicitly addressed in this answer. Sure, it's unlikely that the "core rope encoding" interpretation is what the original post was trying to say, but either way the statement clearly isn't true. – Kyle Strand Jan 29 '16 at 19:55
  • 1
    "woven" might be a better word choice than "written" (that's also what the quote uses) – David Brown Jan 29 '16 at 19:57
  • 30
    The answer as written badly conflates the composition of the program, ("coding" or "writing") which was done by a programming team led by Hamilton, with the construction of the physical hard-wired core-rope memories, which was done by a separate team of "little old ladies". It's like saying a novel was written by a print shop. – Russell Borogove Jan 29 '16 at 19:59
  • 4
    @RussellBorogove Actually it would be like composing a *manuscript* and copying it to a handwritten codex, like the monks did in the middle ages. Both qualify as "writing", but in different senses. – Sklivvz Jan 29 '16 at 20:02
  • 12
    I can't express how strongly I disagree with that interpretation. – Russell Borogove Jan 29 '16 at 20:08
  • "By hand" implies the physical print-out of the code, does it not? – Nacht Jan 30 '16 at 07:27
  • "NASA contradicts this by saying that it was a whole team lead by her, which seems entirely more likely:" Does anyone have any idea as to what percentage of that code in the pile was actually made of her own hand, and how it compares to other members of the team? – The_Sympathizer Jan 30 '16 at 12:03
  • 2
    The first computers I worked on had core memory. I do not recall anyone calling them "core rope memory" or "LOL memory" although we were told only women were trusted to thread the wires through the magnetic rings since it was thought to require the same skills as knitting. The position of the wires did not represent anything. Passing currents down the wires set the rings to one of two magnetic states with one state representing zero and the other one. – Tony Dallimore Jan 30 '16 at 22:50
  • 1
    @TonyDallimore Using core for RAM was common practice but hard coding 'core rope memory' as ROM was apparently a thing. Just Google it. – richardb Jan 31 '16 at 11:20
  • 2
    With regards to "written by hand" part. It appears that the AGC programming team actually used pen to write the code (instead of keyboard) on special forms that are then handed over to typists (who typed it, but note, the programmers did not type it - they wrote it by hand). – slebetman Feb 01 '16 at 09:23
  • 1
    Actually, in that era it's likely that she DID write it out "by hand" and then have it converted to cards by a keypunch operator. – Daniel R Hicks Jul 18 '20 at 12:16
  • 4
    **"typewriter or a daisy printer"** Unlikely: it was probably a line printer in those days. (Daisy printer invented 1970, Apollo went to the moon 1969). – GEdgar Jul 18 '20 at 14:30
  • 2
    The code was almost certainly printed using a line printer. Selectric "ball" printers were used at that time, as were Teletype printers, but they were both far too slow, plus they didn't handle wide forms well. – Daniel R Hicks Jul 23 '20 at 23:45
61

I've known Margaret for 20 years and when my son pointed this question out to me I emailed her and Ron Hackler (who I've also known for 20 years) to clarify some of this. They replied as follows:

"To clarify, Margaret was the Director of the Apollo on-board flight software (the Apollo Guidance Computer (AGC) software). http://www.nasa.gov/home/hqnews/2003/sep/HQ_03281_Hamilton_Honor.html That is, she was "in charge" of (responsible for) the Apollo on-board flight software and the AGC programmers ("software engineers") who designed and developed the Apollo on-board flight software. She also designed and wrote much of the Apollo on-board flight software, herself; especially in the area of designing/building AGC systems software where favorites of hers were in the areas of the operating system, man machine interface, reliability and error detection and recovery.

Margaret and her team at MIT coded all of the code by hand: that is, they wrote all of the AGC source code on AGC source coding paper, and then would give it to the "keypunchers" (key punch people) to copy (punch) the code from the coding paper onto cards from which listings (books/printouts) of the code could be made.

Yes, it is all code that Margaret is standing next to in the photo of her!!! It is AGC code (and NOT anything else)!"

They pointed out that there is a photo of some of the pages of Margaret's copy of the AGC code here: https://i.stack.imgur.com/AxYV4.jpg along with some other supporting information provided by Margaret and Ron. As well, this code is all handwritten assembly code for the AGC - no compilers involved.

I'd add that Margaret and Ron are two of the most brilliant people I've had the privilege of knowing in my lifetime.

Steve Dolha
  • 711
  • 4
  • 3
15

This question has been asked on Quora - here is Christopher Burke's answer:

I downloaded the source code this afternoon and ran some simple metrics on it, looking only at the ".agc" files which are the assembly language source.

  • 420,837 lines of source
  • Of these, 102,958 lines of comments ("#" in column 1) and 38,626 empty lines
  • 10,305 instances of " Page " indicating, roughly, the number of pages in the source listings

These old listings were printed on "green bar" continuous form paper about 3.6 mils thick, probably at 66 lines (max) per page. Here's a modern equivalent:

Enterprise Group Continuous Form Paper 14 78 x 11 18 Lb 12 Green BarWhite Pack Of 3000 Sheets by Office Depot & OfficeMax

10,305 pages of this stuff would be about 37 inches tall, fresh out of the box. It might expand some with use, annotation, constant flexing, and so on, and the binders are also relatively heavy. It's easy to account for maybe 42" of the stack that way. Old or alternate versions of some of the listings could make up the rest of the height.

A single team could certainly write that much assembler code. The code would likely be extremely efficient, since the system had very tight memory constraints.

As a crude benchmark, Paul Laughton wrote a 120 page DOS for the Apple II in assembler in 7 weeks. Apple II DOS source code. Scaling this up, a team of 12 could crank out more than 10,305 pages of high-quality code in a year.

Looking at Paul's line printer listing (there's a PDF on the linked site), you can get a good feel for how dense information is in this kind of code. There's a lot of whitespace: old-time assembler programmers, myself included, used pagination to isolate unrelated sections of code, as we were often reading these printouts and not the source code during hand-optimization.

Franck Dernoncourt
  • 7,224
  • 4
  • 33
  • 76
  • 3
    We have the actual scans of the pages, the count is off by about 10%. – Sklivvz Jan 29 '16 at 15:06
  • Also, a Quora answer is not really a great way to reference an answer... – Sklivvz Jan 29 '16 at 15:09
  • 2
    Yes but the answer itself contains references. – Franck Dernoncourt Jan 29 '16 at 15:10
  • 4
    Re "...often reading these printouts and not the source code...": I don't know about NASA, but in those days (and for a decade or so later), CRT/keyboard displays were not common. It was usual to input code on punch cards, and read the printouts. – jamesqf Jan 29 '16 at 18:47
  • 9
    -1: If this Quora answer was posted here it would deleted for original research; we have no reason to trust Christopher Burke's expertise or assumptions in his calculations, e.g. his decision to only look at .agc files and that therefore comments start with a '#' are demonstrably incorrect in the [first page of the scan](http://www.ibiblio.org/apollo/ScansForConversion/Artemis072/0001-P1090592.jpg). – Oddthinking Jan 29 '16 at 23:14
  • 2
    @Oddthinking I think it's a decent approximation, and an explanation is better than a reference (no need to trust, only think/check). Regarding #, most comments start with '#', and we're mostly looking for SLOC upper bound anyway. – Franck Dernoncourt Jan 30 '16 at 15:36
  • 1
    You seem to be making [an appeal to common sense](http://www.mcckc.edu/longview/socsci/psyc/westra/CommonSense/cs4.html) fallacy by arguing there is no need for a reference. You are making a "begging the question" fallacy by saying it is a decent approximation. – Oddthinking Jan 30 '16 at 16:16
  • 1
    @Oddthinking No need for common sense, just counting ability. – Franck Dernoncourt Jan 30 '16 at 17:04