< Return to Video

RailsConf 2014 - Software Development Lessons from the Apollo Program by Julian Simioni

  • 0:17 - 0:18
    JULIAN SIMIONI: All right. Everyone can hear
    me well now?
  • 0:18 - 0:19
    They've turned it off. Everything's good.
  • 0:19 - 0:22
    All right. It says 3:50 on the little clock
  • 0:22 - 0:23
    here which means it's time for me to go.
  • 0:23 - 0:27
    So, hi everyone. I'm Julian. This is my first
  • 0:27 - 0:30
    RailsConf. It's great to be here. We are not
  • 0:30 - 0:32
    gonna talk about Rails at all. We're gonna
    talk
  • 0:32 - 0:35
    about space. This is one of my favorite pictures
  • 0:35 - 0:37
    ever, right. It's the, the Earth rise picture
    from
  • 0:37 - 0:40
    Apollo 8.
  • 0:40 - 0:43
    And my whole life, I've just loved space.
    From
  • 0:43 - 0:45
    when I was a little kid, it just inspired
  • 0:45 - 0:47
    me so much. I know it inspires tons of
  • 0:47 - 0:49
    other people. I know, I got into a technical
  • 0:49 - 0:51
    field because, as a kid, I loved space. Raise
  • 0:51 - 0:53
    your hand if you think it's the same thing
  • 0:53 - 0:55
    for you. I know I've talked to so many
  • 0:55 - 0:57
    people where that's the case. Awesome.
  • 0:57 - 1:00
    And I mean, just, space is really cool, right.
  • 1:00 - 1:03
    There is, just, you know, everything about
    astronomy or
  • 1:03 - 1:07
    manned space explorations is just really,
    really awesome and
  • 1:07 - 1:12
    inspiring. And there's one thing, above all
    else, that
  • 1:12 - 1:15
    inspires people just so much, and that, of
    course,
  • 1:15 - 1:18
    is the Apollo program.
  • 1:18 - 1:21
    Landing on the moon is, maybe, the greatest
    thing
  • 1:21 - 1:25
    that humans have ever done. And, and, you
    know,
  • 1:25 - 1:27
    people will talk about awesome rockets, right.
    Like, the
  • 1:27 - 1:30
    Saturn 5. It generates seven and a half million
  • 1:30 - 1:34
    pounds of thrust on takeoff. That's. That's
    a lot.
  • 1:34 - 1:37
    Or they'll talk about, you know, astronauts
    who, who
  • 1:37 - 1:40
    trained for years, and, you know, were brave
    and
  • 1:40 - 1:42
    took insane risks that, you know, most of
    us
  • 1:42 - 1:45
    can't even comprehend. Or they'll talk about
    mathematicians and
  • 1:45 - 1:48
    awesome things they did for, like, the guidance
    equations
  • 1:48 - 1:49
    and stuff to get people to the moon safely
  • 1:49 - 1:50
    and back.
  • 1:50 - 1:53
    And then they'll say things, like, oh, yeah,
    we,
  • 1:53 - 1:55
    we landed on the moon with, you know, less
  • 1:55 - 1:58
    computing power in a wrist watch, or something.
    And
  • 1:58 - 2:01
    as a software developer, you know, that makes
    me
  • 2:01 - 2:03
    sad. You know, for a long time, I didn't
  • 2:03 - 2:05
    really think that there was anything in the
    Apollo
  • 2:05 - 2:10
    program to inspire us software developers.
    And, fortunately, it
  • 2:10 - 2:12
    turns out, that is not at all the case.
  • 2:12 - 2:15
    So this is the Apollo guidance computer. To
    give
  • 2:15 - 2:18
    you a sense of the scale, the little display
  • 2:18 - 2:19
    is, like, a little bit bigger than your hand.
  • 2:19 - 2:22
    I think it's like, nine by nine inches. So
  • 2:22 - 2:23
    this thing was built to take people to the
  • 2:23 - 2:30
    moon. And it is awesome in ways you might
  • 2:30 - 2:30
    not expect.
  • 2:30 - 2:33
    So it only had two kilobytes of RAM, I
  • 2:33 - 2:36
    think. Not very much. It was really, really,
    really
  • 2:36 - 2:42
    slow. I did some back-of-the-envelope calculations,
    and it turns
  • 2:42 - 2:45
    out all of the computation done on all of
  • 2:45 - 2:48
    the Apollo missions, ever, could be done by
    my
  • 2:48 - 2:53
    little laptop over there in under a second.
  • 2:53 - 2:57
    But, my laptop may or may not make it
  • 2:57 - 3:03
    through this talk. The Apollo guidance computer
    never hit
  • 3:03 - 3:06
    an unknown bug, in thousands of hours of time
  • 3:06 - 3:09
    in space. It never failed, despite the fact
    that
  • 3:09 - 3:16
    space is pretty hostile, right. There's, there's
    like gamma
  • 3:16 - 3:19
    rays. Anything metallic that floats around
    will, will find
  • 3:19 - 3:21
    the one place where it can short things out
  • 3:21 - 3:25
    and, and cause lots of problems.
  • 3:25 - 3:27
    And so this thing is pretty amazing. It worked
  • 3:27 - 3:30
    really, really well. But what's even more
    amazing is
  • 3:30 - 3:33
    that it was built at a time when we
  • 3:33 - 3:37
    didn't know much about making software. They
    started working
  • 3:37 - 3:41
    on it in 1961. And they finished in 1968.
  • 3:41 - 3:47
    So to put that into perspective, in 1965,
    the
  • 3:47 - 3:51
    MIT instrumentation lab, that's the department
    of MIT that
  • 3:51 - 3:54
    was building this thing, they got this new
    computer.
  • 3:54 - 3:56
    It's called an IBM system 360. Anyone heard
    of
  • 3:56 - 4:00
    that before? It's one of the more famous computers
  • 4:00 - 4:01
    in the history of computing.
  • 4:01 - 4:04
    So there's one particularly famous person
    that worked on
  • 4:04 - 4:06
    it. And anyone know who I'm talking about?
    Anyone
  • 4:06 - 4:09
    have an idea? Come on, you all know. Fred
  • 4:09 - 4:11
    Brooks, right. And he, he wrote this book.
    What
  • 4:11 - 4:15
    was the book called? Anyone? The Mythical
    Man Month.
  • 4:15 - 4:18
    Yeah. So when did he write that book? Not
  • 4:18 - 4:21
    until 1975. And by then, you know, we had
  • 4:21 - 4:24
    been gone from the moon for many, many years.
  • 4:24 - 4:27
    So think about what that means, right. The,
    the
  • 4:27 - 4:31
    software developers writing code for the Apollo
    Guidance Computer
  • 4:31 - 4:35
    were learning the same things as Fred Brooks
    at
  • 4:35 - 4:37
    the same time, right. So if you're a manager
  • 4:37 - 4:39
    at a, you know, you have some software developers
  • 4:39 - 4:40
    working under you, and your boss comes to
    you
  • 4:40 - 4:42
    and says hey, you know, your projects a little
  • 4:42 - 4:45
    bit late. I'm gonna, you know, give you some
  • 4:45 - 4:49
    more developers to hopefully speed it up,
    you say,
  • 4:49 - 4:52
    OK. Whereas today you might say, no. Read
    The
  • 4:52 - 4:55
    Mythical Man Month, and you know that that
    won't
  • 4:55 - 4:56
    work.
  • 4:56 - 5:01
    So, another thing. The word software was first
    used
  • 5:01 - 5:04
    in 1950. It was used in, like, a research
  • 5:04 - 5:09
    paper. And there's some back story here. It's
    pretty
  • 5:09 - 5:11
    important. We're gonna do a little aside.
  • 5:11 - 5:15
    So, the first computers in, in the, you know,
  • 5:15 - 5:20
    20s, 30s, 40s. They were built by men. Like,
  • 5:20 - 5:25
    predominantly, overwhelmingly men. And, and
    they would build these
  • 5:25 - 5:28
    computers, and the computers did one thing,
    right. You
  • 5:28 - 5:32
    would build a computer to, you know, calculate
    the
  • 5:32 - 5:33
    Fibonacci sequence or something, and if you
    wanted a
  • 5:33 - 5:37
    computer to, to calculate prime numbers, like,
    you built
  • 5:37 - 5:39
    another computer, or you took the computer
    you had
  • 5:39 - 5:43
    and, and modified it really heavily, right.
    And over
  • 5:43 - 5:45
    time, you know, computers got a little bit
    better
  • 5:45 - 5:47
    and, and then they could sort of be configured,
  • 5:47 - 5:49
    right. They could, you could like, flip some
    switches
  • 5:49 - 5:51
    and set some bits and then the computers would
  • 5:51 - 5:56
    do different things and, and, and the men
    building
  • 5:56 - 5:58
    these computers that, they hated this task,
    right. They
  • 5:58 - 6:02
    thought it was boring and that it was easy
  • 6:02 - 6:04
    and that it wasn't very interesting at all.
    So
  • 6:04 - 6:07
    they hired a bunch of women to do all
  • 6:07 - 6:10
    these things, right. And only later, like,
    as time
  • 6:10 - 6:13
    goes on, did they figure out that, that this
  • 6:13 - 6:17
    task of configuring the computer that, that
    the men
  • 6:17 - 6:19
    had built was actually the entire field of
    software
  • 6:19 - 6:23
    development, and that it was actually really,
    really hard
  • 6:23 - 6:27
    and challenging and it was a field onto itself.
  • 6:27 - 6:30
    And only then did, did men start coming in
  • 6:30 - 6:34
    and start saying, hey, I would like to do
  • 6:34 - 6:36
    this. During the Apollo program, one of the
    managers
  • 6:36 - 6:41
    of, of one of the software teams, when he
  • 6:41 - 6:44
    was assigned to that team, his wife was told
  • 6:44 - 6:46
    by him, hey, honey, don't tell any of our
  • 6:46 - 6:48
    friends that I manage a software team. Cause
    it
  • 6:48 - 6:51
    wasn't, it wasn't cool for a guy to write
  • 6:51 - 6:54
    software, yet, in the, in the 60s. It was,
  • 6:54 - 6:55
    it was getting there.
  • 6:55 - 6:59
    So, it's kind of interesting, right. So here's
    my
  • 6:59 - 7:02
    takeaway from that. If you're a woman and
    you're
  • 7:02 - 7:06
    writing some software, and you're maybe thinking,
    hey, you
  • 7:06 - 7:07
    know, maybe I'm not cut out for this or,
  • 7:07 - 7:09
    or some other people are saying things that
    say
  • 7:09 - 7:12
    that I shouldn't be here. Don't listen to
    them.
  • 7:12 - 7:16
    That's bull shit. You're grandma was writing
    code. And,
  • 7:16 - 7:17
    and she did a damn fine job. So don't
  • 7:17 - 7:18
    worry about that.
  • 7:18 - 7:20
    And if you're a guy, a man, or woman
  • 7:20 - 7:23
    I guess, and you're thinking or saying or
    writing
  • 7:23 - 7:26
    things like, you know, women shouldn't be
    here. They're
  • 7:26 - 7:29
    not as good at writing code as men. Stop.
  • 7:29 - 7:32
    Stop saying those things. That is all bull
    shit.
  • 7:32 - 7:35
    It, that does not stand up to the history
  • 7:35 - 7:38
    of computing. So. Just a little aside there.
  • 7:38 - 7:42
    Anyways, OK. We're talking about the Apollo
    Guidance Computer,
  • 7:42 - 7:46
    and things that people learned from that.
    So, what,
  • 7:46 - 7:49
    let me ask you guys a question. How many
  • 7:49 - 7:52
    of you have built some sort of web app,
  • 7:52 - 7:55
    maybe a Rails app or something, and you depend
  • 7:55 - 7:58
    on someone else to service. Right, an API
    or
  • 7:58 - 8:00
    something like that. Someone, something that
    another team at
  • 8:00 - 8:01
    your company built or something external,
    right. And what
  • 8:01 - 8:04
    happened to your site the first time that
    thing
  • 8:04 - 8:09
    went down? Yeah, I heard a very sad noise
  • 8:09 - 8:11
    of something breaking.
  • 8:11 - 8:13
    Yeah. Exactly. Your pager goes off. Although
    maybe in
  • 8:13 - 8:17
    the 60s, I don't think they even had pagers.
  • 8:17 - 8:19
    So what did you do after awhile, right? You,
  • 8:19 - 8:22
    you, the first time you fixed that one thing,
  • 8:22 - 8:24
    right, you fixed it so that that particular
    thing
  • 8:24 - 8:28
    happens again, you know, it'll be OK. And
    then
  • 8:28 - 8:31
    something else happens and something else
    happens, and hopefully
  • 8:31 - 8:37
    after awhile you, your, your system is smart
    enough
  • 8:37 - 8:40
    that anything that this, this other system
    throws at
  • 8:40 - 8:44
    you, something you've never even seen before,
    you know,
  • 8:44 - 8:49
    it doesn't matter. You'll keep running just
    fine.
  • 8:49 - 8:51
    And so the same thing happened during the
    Apollo
  • 8:51 - 8:55
    11 landing. So this is the Lunar module. So,
  • 8:55 - 8:58
    so picture, this is the most critical moment
    of
  • 8:58 - 9:00
    the entire Apollo space program, right. Neil
    Armstrong and
  • 9:00 - 9:02
    Buzz Aldrin are, are in this little thing.
    They're
  • 9:02 - 9:06
    heading down towards the surface of the moon.
    And
  • 9:06 - 9:07
    this, the last ten minutes of this are by
  • 9:07 - 9:12
    far the most, absolutely the most critical
    and, and
  • 9:12 - 9:15
    high intensity part of the entire, of the
    entire
  • 9:15 - 9:16
    mission.
  • 9:16 - 9:19
    Neil Armstrong said that those last couple
    of minutes,
  • 9:19 - 9:21
    on a difficulty scale of one to ten were
  • 9:21 - 9:23
    a thirteen, right. And he's, he's a pretty
    good
  • 9:23 - 9:25
    pilot. So that means a lot.
  • 9:25 - 9:28
    So, so, so they're cruising down towards,
    towards the
  • 9:28 - 9:31
    surface. They're, they're busy. They're in
    the zone. All
  • 9:31 - 9:34
    of the sudden, on their dashboard, you know,
    a
  • 9:34 - 9:37
    big light comes on. The master alarm. Everything
    is
  • 9:37 - 9:41
    wrong. And their computer is, is giving them
    this
  • 9:41 - 9:43
    error, this, like, twelve-oh-one error.
  • 9:43 - 9:45
    And, you know, the astronauts are distracted
    and mission
  • 9:45 - 9:47
    control, they're freaking out. They're trying
    to figure out
  • 9:47 - 9:51
    what this is. You know, what does this mean?
  • 9:51 - 9:53
    One of the MIT engineers in, in mission control
  • 9:53 - 9:57
    had, very wisely, made a little cheat sheet
    of
  • 9:57 - 10:00
    every error code that the computer could throw
    up.
  • 10:00 - 10:03
    Very, very smart.
  • 10:03 - 10:06
    And he, you know, he, he looks up, OK,
  • 10:06 - 10:08
    twelve-oh-one. What does it say? It says,
    if, if
  • 10:08 - 10:09
    nothing else seems wrong, you know, you're
    good to
  • 10:09 - 10:14
    go for the landing, and he actually was too
  • 10:14 - 10:16
    scared to form words, so when he was asked,
  • 10:16 - 10:17
    you know, are we good to go? He just
  • 10:17 - 10:20
    sort of like, made a thumbs up. And then
  • 10:20 - 10:22
    he was awarded a medal from the President
    of
  • 10:22 - 10:24
    the United States for his, for his decision
    to,
  • 10:24 - 10:26
    to not abort the moon landing.
  • 10:26 - 10:28
    So what happened? What was this master alarm
    that
  • 10:28 - 10:31
    scared the crap out of everyone for actually
    no
  • 10:31 - 10:37
    reason? So, today we're pretty lucky with
    our computers,
  • 10:37 - 10:40
    right. If you, if you write some code that
  • 10:40 - 10:41
    does an infinite loop or something, your computer
    will
  • 10:41 - 10:44
    probably handle it just fine, right. You have
    to,
  • 10:44 - 10:46
    you have to do something pretty crazy to crash
  • 10:46 - 10:49
    your computer.
  • 10:49 - 10:53
    The very idea that multiple programs could
    even be
  • 10:53 - 10:54
    running on a computer was new in the 90s,
  • 10:54 - 10:57
    1960s. They, they didn't have words like scheduling
    or
  • 10:57 - 11:02
    tasks or processes like we have today. They
    called
  • 11:02 - 11:07
    it, they called it, like, like, timesharing,
    right. And,
  • 11:07 - 11:11
    and up until the Apollo, Apollo guidance computer
    had
  • 11:11 - 11:15
    been built, they didn't do anything sophisticated
    like, like
  • 11:15 - 11:18
    have priorities assigned to different tasks.
    They just said,
  • 11:18 - 11:18
    anything that wants to run, we'll let it run
  • 11:18 - 11:20
    for a little while, and then we'll run something
  • 11:20 - 11:21
    else.
  • 11:21 - 11:24
    And a lot of engineers thought that this approach
  • 11:24 - 11:26
    was safe, because it was more predictable,
    and it
  • 11:26 - 11:28
    was easier to reason about. But it has a
  • 11:28 - 11:35
    downside, in that you, with something like
    priority-based scheduling,
  • 11:35 - 11:39
    you can, you can figure out what are the
  • 11:39 - 11:41
    most important things that need to be running,
    right.
  • 11:41 - 11:43
    The program to fire the thrusters should probably
    run
  • 11:43 - 11:46
    exactly when it wants. The program to update
    the
  • 11:46 - 11:48
    display for the astronauts, if it's a couple
    milliseconds
  • 11:48 - 11:49
    late, I think they'll be OK.
  • 11:49 - 11:51
    And so this was a brand new approach for
  • 11:51 - 11:54
    the Apollo program, or for computing in general.
    So,
  • 11:54 - 11:58
    the takeaway here is handle failure gracefully.
    Just do
  • 11:58 - 12:00
    a little bit of actual work so that something
  • 12:00 - 12:03
    unexpected can come up and you'll handle it
    just
  • 12:03 - 12:04
    fine.
  • 12:04 - 12:06
    Step two of that, by the way, is if
  • 12:06 - 12:08
    you get to the point where you can handle
  • 12:08 - 12:11
    an unknown failure gracefully, don't throw,
    like a master
  • 12:11 - 12:16
    caution alarm and raise a ruckus when, you
    know,
  • 12:16 - 12:18
    you're actually handling everything great.
  • 12:18 - 12:22
    OK. So, who would have ever thought that in
  • 12:22 - 12:26
    a RailsConf, talking about testing would be,
    would be
  • 12:26 - 12:28
    weird? But I have an entire segment about
    testing.
  • 12:28 - 12:31
    Thanks DHH for that.
  • 12:31 - 12:36
    So, there were lives on the line. They're
    traveling
  • 12:36 - 12:38
    into space, which is pretty difficult. There
    was a
  • 12:38 - 12:40
    ton of testing for the software, for the software
  • 12:40 - 12:45
    for the Apollo Guidance Computer. They, they
    had unit
  • 12:45 - 12:46
    tests. They actually even called them unit
    tests but
  • 12:46 - 12:48
    with, with quotes, cause it was like a brand
  • 12:48 - 12:50
    new word for them.
  • 12:50 - 12:54
    But the, the engineers didn't really talk
    much about
  • 12:54 - 12:56
    their unit tests. They said they were OK,
    but
  • 12:56 - 13:00
    they didn't, like, rant and rave about them.
    And
  • 13:00 - 13:01
    I have a theory as to why that is,
  • 13:01 - 13:04
    and that's because most of the code for the
  • 13:04 - 13:08
    Apollo Guidance Computer was, was, was like
    functional code.
  • 13:08 - 13:10
    Not in like the programming sense but al,
    also
  • 13:10 - 13:12
    in the mathematical sense on which it's based.
    Right?
  • 13:12 - 13:17
    You have, you have code for guidance equations.
    And
  • 13:17 - 13:19
    furthermore you have mathematicians writing
    them.
  • 13:19 - 13:21
    The idea of a computer science degree did
    not
  • 13:21 - 13:23
    exist in the 1960s. I think the last, the
  • 13:23 - 13:26
    first computer science degree was actually
    awarded, like, in
  • 13:26 - 13:29
    the late 60s. So no one writing these computers
  • 13:29 - 13:32
    was trained as a software programmer, right,
    or as
  • 13:32 - 13:35
    a computer scientist. They were trained as
    mathematicians. And
  • 13:35 - 13:37
    they were writing code to implement mathematical
    equations. And,
  • 13:37 - 13:40
    as you can imagine, eventually they'll get
    it right.
  • 13:40 - 13:43
    So, what they do talk really, really highly
    about
  • 13:43 - 13:45
    is their, their integration tests. And now,
    I have
  • 13:45 - 13:47
    no idea. Should we call these system tests
    or
  • 13:47 - 13:51
    some other kind of tests? But anyways.
  • 13:51 - 13:55
    In 1972, they published a retrospective on
    basically the
  • 13:55 - 14:00
    entire software development effort, and they
    said things. They,
  • 14:00 - 14:03
    they talked specifically about things that
    plagued the software
  • 14:03 - 14:06
    development effort throughout the entire program.
    And they listed
  • 14:06 - 14:08
    two things, and they're both really interesting.
    I have
  • 14:08 - 14:09
    a link to it at the end of my
  • 14:09 - 14:12
    slide, so definitely check it out when you
    get
  • 14:12 - 14:12
    a chance.
  • 14:12 - 14:14
    The first thing that they just could not get
  • 14:14 - 14:18
    right was estimating schedules. And we don't
    get that
  • 14:18 - 14:20
    right today so, great. We've made a lot of
  • 14:20 - 14:22
    progress there. One cool thing they did actually
    was
  • 14:22 - 14:24
    they, they cataloged a bunch of ways in which
  • 14:24 - 14:26
    they can go wrong, right. Like if you have,
  • 14:26 - 14:30
    if you have two projects competing, or two
    projects
  • 14:30 - 14:34
    that are running in parallel, and one of them
  • 14:34 - 14:38
    is gonna take longer, and you make the one
  • 14:38 - 14:41
    that is not gonna take as long happen even
  • 14:41 - 14:44
    faster, you haven't actually made your whole
    project progress
  • 14:44 - 14:48
    any faster, right. Just to give an example.
  • 14:48 - 14:51
    The other thing they talked about, that plagued
    their
  • 14:51 - 14:55
    whole project, was getting up to date specs
    and
  • 14:55 - 15:01
    requirements and information about different
    systems. The Apollo program,
  • 15:01 - 15:03
    you know, was in a rush throughout its entire
  • 15:03 - 15:06
    development. Everything, every part of every
    system in the
  • 15:06 - 15:10
    space craft was constantly changing. And getting
    up to
  • 15:10 - 15:13
    date information about these other things
    is hard, right.
  • 15:13 - 15:14
    You have to go out and talk to every
  • 15:14 - 15:17
    team, and if they don't happen to tell you
  • 15:17 - 15:19
    that something's changing, you might not know.
  • 15:19 - 15:22
    Again, they didn't come up with a great way
  • 15:22 - 15:25
    to solve this, and again we still struggle
    with
  • 15:25 - 15:26
    this today. I think communication is the hardest
    part
  • 15:26 - 15:29
    of software development. But they did find
    out a
  • 15:29 - 15:32
    great way to figure out if you have it
  • 15:32 - 15:34
    wrong. And that's to write integration tests,
    where you
  • 15:34 - 15:37
    take everything together, right. Every part
    of your system,
  • 15:37 - 15:39
    and you test the hell out of it and
  • 15:39 - 15:41
    see what breaks.
  • 15:41 - 15:48
    And, and, and, so. What happens is, there's
    a
  • 15:50 - 15:53
    really interesting thing where your unit tests
    with test
  • 15:53 - 15:55
    your own code, and then you have integration
    tests,
  • 15:55 - 15:58
    which are also code. But they're not there
    so
  • 15:58 - 16:01
    much, they're not there so much to test your
  • 16:01 - 16:05
    code as they are to test your communication.
    So
  • 16:05 - 16:11
    to put it another way, if you. How do
  • 16:11 - 16:14
    I put this? Let's see.
  • 16:14 - 16:17
    If you, if your integration tests are failing,
    what
  • 16:17 - 16:20
    it means, not necessarily that you wrote bad
    code,
  • 16:20 - 16:23
    but you wrote great code that does the wrong
  • 16:23 - 16:29
    thing, right. So, so that's the takeaway there.
  • 16:29 - 16:32
    Another great thing they did that we don't
    do
  • 16:32 - 16:34
    today, is they tested what they call the off
  • 16:34 - 16:37
    nominal cases, which is just an awesome word,
    right.
  • 16:37 - 16:40
    We don't use nominal nearly enough anymore.
  • 16:40 - 16:46
    So, so. They said for every single, for every
  • 16:46 - 16:48
    one test they had that tested like the normal
  • 16:48 - 16:49
    case of things going right during a mission,
    they
  • 16:49 - 16:54
    had a hundred that tested things going wrong.
  • 16:54 - 16:55
    So how many of you guys have a test
  • 16:55 - 16:57
    in your Rails app, something like, if a user
  • 16:57 - 17:01
    logs in with the right username and the right
  • 17:01 - 17:03
    password, they get logged in, right. I, I
    do.
  • 17:03 - 17:05
    Right. A lot of hands go up. How many
  • 17:05 - 17:08
    of you guys have a test where if someone
  • 17:08 - 17:10
    puts in the right username and the wrong password,
  • 17:10 - 17:13
    they don't get logged in, right. Fewer hands
    go
  • 17:13 - 17:13
    up.
  • 17:13 - 17:16
    I didn't have that test until I was making
  • 17:16 - 17:20
    this talk. So I mean, there's so many different
  • 17:20 - 17:22
    tests for things going wrong that, that we
    don't
  • 17:22 - 17:25
    write today, I think. Anything from, you know,
    security
  • 17:25 - 17:28
    related or, or like, checking of all sorts
    of,
  • 17:28 - 17:33
    you know, inputs and stuff like that. But
    the
  • 17:33 - 17:36
    Apollo Guidance Computer team got it right,
    and there
  • 17:36 - 17:39
    were all sorts of cases during the Apollo
    program
  • 17:39 - 17:42
    where, where something went a little bit wrong
    and,
  • 17:42 - 17:45
    and something unexpected happened, and, and
    like Guidance Computer,
  • 17:45 - 17:47
    because they had done all these off nominal
    tests,
  • 17:47 - 17:50
    came out just fine.
  • 17:50 - 17:52
    So let's talk about their teams.
  • 17:52 - 17:59
    In 1961 when, when the instrument lab signed
    the
  • 17:59 - 18:01
    contract to deliver the Apollo Guidance Computer,
    that contract
  • 18:01 - 18:04
    didn't mention software at all. It said, you
    just
  • 18:04 - 18:07
    have to give us this, this box, with a
  • 18:07 - 18:10
    computer in it that can take men to the
  • 18:10 - 18:10
    moon.
  • 18:10 - 18:12
    And, so they didn't know if it was just
  • 18:12 - 18:14
    gonna be, you know, just a bunch of hardware
  • 18:14 - 18:16
    and it did this one thing and that's all
  • 18:16 - 18:17
    it needed or if it was gonna be like
  • 18:17 - 18:20
    a, you know, a fully programmable computer
    like it
  • 18:20 - 18:22
    turned out to be.
  • 18:22 - 18:27
    They, they didn't know, in 1961, what a space
  • 18:27 - 18:28
    craft that goes to the moon would look like
  • 18:28 - 18:31
    at all. They didn't know, you know, would
    it
  • 18:31 - 18:32
    be one giant ship that goes all the way
  • 18:32 - 18:33
    to the moon and then comes all the way
  • 18:33 - 18:36
    back? Would it be several little ships that
    are
  • 18:36 - 18:38
    combined together? Would they build two rockets
    and have
  • 18:38 - 18:39
    them meet up in space and then go from
  • 18:39 - 18:41
    there? Would they build one giant rocket?
    No one
  • 18:41 - 18:42
    knew.
  • 18:42 - 18:45
    No one knew if, even in principle, it would
  • 18:45 - 18:49
    be possible to navigate to the moon, right.
    They
  • 18:49 - 18:52
    didn't have the math to, to prove that you
  • 18:52 - 18:54
    could go to the moon. And no one knew,
  • 18:54 - 18:56
    even given math that can help you navigate
    to
  • 18:56 - 18:58
    the moon, if a computer could be built to
  • 18:58 - 19:00
    do it.
  • 19:00 - 19:03
    So there were, in these early days, there
    were,
  • 19:03 - 19:07
    you know, no deadlines. No managers. No requirements.
    Very
  • 19:07 - 19:12
    little communication with, with other teams.
    And what that
  • 19:12 - 19:14
    means is they were free to experiment and,
    and
  • 19:14 - 19:16
    figure things out, right.
  • 19:16 - 19:19
    A couple years later, OK. Now they know, we're
  • 19:19 - 19:22
    gonna go to the moon. One giant rocket. Two
  • 19:22 - 19:24
    little space crafts. One is just for landing
    on
  • 19:24 - 19:27
    the moon. We have figured out that, just like
  • 19:27 - 19:29
    at sea, you can use a sextant and measure
  • 19:29 - 19:31
    the angles between, like, stars and part of
    the
  • 19:31 - 19:32
    moon or part of the Earth and figure out
  • 19:32 - 19:35
    exactly where you are. And now we know what
  • 19:35 - 19:38
    the math looks like to take those, those navigation
  • 19:38 - 19:40
    measurements and plug them into a computer,
    which we
  • 19:40 - 19:41
    now know how to build, and we know it
  • 19:41 - 19:43
    can fit in a space craft and it can
  • 19:43 - 19:45
    take you to the moon.
  • 19:45 - 19:48
    So now there's four hundred software developers
    in the
  • 19:48 - 19:53
    Apollo Guidance Computer project. And now
    there's, there's lots
  • 19:53 - 19:57
    of managers. There's lots of deadlines. There's
    lots of
  • 19:57 - 20:04
    requirements. There's lots of documentation.
    So what happened is
  • 20:04 - 20:06
    they built, they had teams that were the right
  • 20:06 - 20:08
    shape and size for what they were trying to
  • 20:08 - 20:10
    accomplish, right.
  • 20:10 - 20:14
    If, if you were talking to someone who is
  • 20:14 - 20:16
    founding a startup, it's brand new, and they
    said
  • 20:16 - 20:20
    they had four hundred employees, you might
    be a
  • 20:20 - 20:24
    little worried. Likewise, if, if you were
    talking to
  • 20:24 - 20:27
    a programmer that happened to work for your
    bank,
  • 20:27 - 20:29
    and he said, we have a team of, of
  • 20:29 - 20:31
    twenty and we don't really have any requirements
    for,
  • 20:31 - 20:33
    you know, security or anything like that,
    you'd probably
  • 20:33 - 20:35
    find another bank.
  • 20:35 - 20:39
    So, so teams have to be the right shape
  • 20:39 - 20:42
    and size for what they want to accomplish.
    Another,
  • 20:42 - 20:45
    a corollary to that is switching between those
    team
  • 20:45 - 20:50
    sizes will be difficult and, at any given
    time,
  • 20:50 - 20:52
    there will be people unhappy with how your
    current
  • 20:52 - 20:56
    team is shaped. So NASA and the other contractors
  • 20:56 - 20:59
    building the Apollo space craft did not like
    that
  • 20:59 - 21:02
    there were these, these rogue engineers over
    at MIT
  • 21:02 - 21:06
    just fooling around doing whatever they wanted,
    you know,
  • 21:06 - 21:07
    and then that they were gonna have to somehow
  • 21:07 - 21:09
    deliver a guidance computer.
  • 21:09 - 21:13
    Likewise, as the team grew, a lot of the
  • 21:13 - 21:20
    smartest engineers, they left the, the guidance
    project once,
  • 21:20 - 21:22
    especially once Apollo 8 had gone to the moon,
  • 21:22 - 21:24
    right. A lot of the engineers said, OK. We've
  • 21:24 - 21:26
    done it. You know, a couple years ago we
  • 21:26 - 21:28
    had this cool challenge, and now we've figured
    it
  • 21:28 - 21:30
    out. Onto the next thing.
  • 21:30 - 21:32
    But the, the mission to the moon was successful,
  • 21:32 - 21:34
    right. The goal was accomplished. We had landed
    on
  • 21:34 - 21:39
    the moon before 1970. So the team was always
  • 21:39 - 21:40
    the right size.
  • 21:40 - 21:43
    All right, what's next. Let's talk a little
    bit
  • 21:43 - 21:46
    about working with users. Except, in this
    case, it's
  • 21:46 - 21:51
    actually working with astronauts. So, who's
    seen The Right
  • 21:51 - 21:53
    Stuff or read the book? Right, they're both
    great.
  • 21:53 - 21:54
    OK, lots of you.
  • 21:54 - 22:01
    How did they describe astronauts? Anyone?
    What's that? Reckless,
  • 22:01 - 22:05
    OK. Cowboys. Yes. There's a lot of scenes
    of
  • 22:05 - 22:10
    them riding horses around and stuff. They
    were arrogant.
  • 22:10 - 22:13
    They were extremely talented. They were hard
    to work
  • 22:13 - 22:17
    with. They're just like software developers.
  • 22:17 - 22:22
    So, just like any other user, astronauts don't
    know
  • 22:22 - 22:26
    what they want, right. As one of the most
  • 22:26 - 22:28
    important things you can, you can learn about
    working
  • 22:28 - 22:31
    with, with your users is they won't tell you
  • 22:31 - 22:34
    what they actually want. There's a great example
    of
  • 22:34 - 22:34
    this.
  • 22:34 - 22:36
    So the Apollo Guidance Computer was not just
    a
  • 22:36 - 22:38
    guidance computer. It was also an autopilot.
    It could
  • 22:38 - 22:41
    take you from Earth orbit to, you know, a
  • 22:41 - 22:42
    couple feet above the lunar surface, and it
    could
  • 22:42 - 22:45
    take you from the lunar surface all the way
  • 22:45 - 22:46
    back to Earth.
  • 22:46 - 22:49
    So, so the, the engineers at MIT, you know,
  • 22:49 - 22:52
    would talk to the astronauts, and they said,
    hey,
  • 22:52 - 22:54
    hey astronauts. You know, you know how, at
    the
  • 22:54 - 22:55
    end of your mission you have this, this re-entry
  • 22:55 - 22:59
    process and, and it's, it's pretty dangerous,
    right. If
  • 22:59 - 23:01
    you, if you're coming in too steep you can
  • 23:01 - 23:03
    burn up. If you don't come in steep enough
  • 23:03 - 23:05
    you can ricochet out into space and, and you'll
  • 23:05 - 23:07
    never come back. But, but we know we can
  • 23:07 - 23:10
    write an autopilot that will do this for you
  • 23:10 - 23:13
    automatically. You just have to press a couple
    buttons
  • 23:13 - 23:15
    and we'll get you right through every time.
  • 23:15 - 23:17
    And the astronauts said no. Do not do that.
  • 23:17 - 23:20
    You will be wasting your time. We are astronauts
  • 23:20 - 23:22
    and we are trained to do these hard things,
  • 23:22 - 23:25
    like, like do a manual re-entry. And astronauts,
    by
  • 23:25 - 23:29
    the way, were very distrustful of all automation.
    Partially
  • 23:29 - 23:30
    for good reason.
  • 23:30 - 23:32
    In the, in the 50s and 60s, a lot
  • 23:32 - 23:36
    of early flight tests with, especially analogue
    computers flying
  • 23:36 - 23:39
    aircraft had gone, had gone wrong. And a lot
  • 23:39 - 23:42
    of their friends had died. But on the other
  • 23:42 - 23:46
    hand, also, astronauts, you know, are super
    macho, right.
  • 23:46 - 23:50
    They don't like the idea of a computer taking
  • 23:50 - 23:52
    away something that, you know, they use to
    show
  • 23:52 - 23:53
    their skills.
  • 23:53 - 23:55
    So the astronauts said no. Don't even bother
    building
  • 23:55 - 23:58
    this, building this re-entry program, cause
    we'll never use
  • 23:58 - 24:02
    it. So the engineers built it anyways. And
    then
  • 24:02 - 24:06
    it was used on every single mission.
  • 24:06 - 24:09
    It turns out that when you've been in a
  • 24:09 - 24:13
    box in space with no showers and you're eating,
  • 24:13 - 24:17
    like, frozen, like, dehydrated food for like,
    up to
  • 24:17 - 24:20
    a week, and then there's a button you can
  • 24:20 - 24:22
    press so that you just have to sit back
  • 24:22 - 24:25
    and relax, and like four minutes later you're
    in,
  • 24:25 - 24:27
    you know, the warm air of the Pacific ocean
  • 24:27 - 24:29
    or something like that, you're gonna press
    those buttons
  • 24:29 - 24:31
    every single time, instead of doing one more
    hard
  • 24:31 - 24:32
    thing just to get home, when you've already
    done
  • 24:32 - 24:35
    everything you needed to do. So your users
    don't
  • 24:35 - 24:37
    know what they want.
  • 24:37 - 24:41
    Now let's talk about interfaces. Let's imagine
    you've built
  • 24:41 - 24:43
    this computer that can go to the moon, and
  • 24:43 - 24:45
    you've got your astronauts ready to go to
    the
  • 24:45 - 24:49
    moon, how do they talk to each other? Keep
  • 24:49 - 24:51
    in mind, this is the 60s. The field of
  • 24:51 - 24:55
    human computer action, human computer interaction
    isn't invented until
  • 24:55 - 24:57
    1980.
  • 24:57 - 25:00
    You can't use a CRT screen, because they're
    too
  • 25:00 - 25:04
    heavy. You can't use an LCD screen, because
    they
  • 25:04 - 25:08
    haven't been invented yet, either. And you
    can't actually
  • 25:08 - 25:10
    use any type of screen at all. It turns
  • 25:10 - 25:11
    out the Apollo Guidance Computer doesn't have
    the power
  • 25:11 - 25:13
    for anything like that. So you can use, you
  • 25:13 - 25:16
    know, little seven segment LEDs and you can
    use,
  • 25:16 - 25:17
    like, dials and stuff like that.
  • 25:17 - 25:20
    So what do you build that astronauts can use?
  • 25:20 - 25:22
    It has to be powerful, right. It can't just
  • 25:22 - 25:23
    be one button that says take me to the
  • 25:23 - 25:25
    moon and maybe another button that says take
    me
  • 25:25 - 25:29
    back, right. There's a little bit more going
    on.
  • 25:29 - 25:32
    And it has to be something that astronauts
    in
  • 25:32 - 25:34
    space suits can, can deal with, right. So
    I
  • 25:34 - 25:35
    don't think an iPhone would have worked even
    if
  • 25:35 - 25:39
    they had it. It has to be something that
  • 25:39 - 25:41
    you can operate very quickly, right. There's
    a little
  • 25:41 - 25:43
    bit of time pressure when you're moving at,
    you
  • 25:43 - 25:45
    know, five miles per second.
  • 25:45 - 25:47
    So I want to show you what they came
  • 25:47 - 25:51
    up with, and it's, it's this thing. And this
  • 25:51 - 25:53
    is not a very pretty picture, but it's here
  • 25:53 - 25:55
    just as an assurance, because I have a live
  • 25:55 - 25:58
    demo of it actually working. So this is the
  • 25:58 - 26:00
    display and keyboard unit. So we're gonna
    switch over
  • 26:00 - 26:01
    here.
  • 26:01 - 26:04
    So, some very smart people who are not me
  • 26:04 - 26:07
    have used ASM and taken an emulator running
    actually
  • 26:07 - 26:09
    Apollo Guidance Computer code. We have all
    the code,
  • 26:09 - 26:11
    by the way, and you can take a look
  • 26:11 - 26:14
    at it online. And they build an actual, functional
  • 26:14 - 26:17
    interface in your web browser to the guidance
    computer,
  • 26:17 - 26:18
    and I'm gonna show you guys how it works.
  • 26:18 - 26:20
    And I'm gonna see what you guys think.
  • 26:20 - 26:24
    So, so, you can see here, this thing on
  • 26:24 - 26:28
    the, on the left pretty much is the actual
  • 26:28 - 26:29
    interface. And then this stuff on the right
    is
  • 26:29 - 26:32
    just for running the, like the emulation.
    This sort
  • 26:32 - 26:35
    of represents like the, the simulated environment.
    They didn't
  • 26:35 - 26:36
    get this thing.
  • 26:36 - 26:38
    So, so what do we have here? We've got
  • 26:38 - 26:41
    a bunch of lights for, you know, warnings
    and,
  • 26:41 - 26:44
    and status and stuff like that. We've got
    just
  • 26:44 - 26:47
    a couple little bits of display down here.
    And
  • 26:47 - 26:49
    then we've got just a couple buttons. So,
    so
  • 26:49 - 26:52
    let me give you an example of how this
  • 26:52 - 26:54
    works.
  • 26:54 - 26:58
    So, what you can do, is you hit, you
  • 26:58 - 27:00
    pick a verb and then you pick a noun.
  • 27:00 - 27:04
    So a verb is something like, show me some
  • 27:04 - 27:07
    data. So that's verb zero-six. And then a
    noun
  • 27:07 - 27:10
    is something like, basically the current system
    up time
  • 27:10 - 27:13
    is noun sixty-five. And you hit enter. And
    it
  • 27:13 - 27:15
    shows you. You don't get any decimal points.
    So
  • 27:15 - 27:18
    you have. And you don't get any labels.
  • 27:18 - 27:20
    So you have to know what these mean. So
  • 27:20 - 27:22
    I'll, I'll tell you. So this means, this computer's
  • 27:22 - 27:25
    been running for one hour, thirty-one minutes
    and forty-nine
  • 27:25 - 27:29
    point eight eight seconds. OK, let's try something
    else.
  • 27:29 - 27:33
    Let's hit another verb. That's verb one-six.
    So that's
  • 27:33 - 27:36
    similar to verb six, except what it means
    is
  • 27:36 - 27:38
    show me some data and then keep updating it.
  • 27:38 - 27:41
    And then we'll do noun sixty-five again.
  • 27:41 - 27:44
    So now, again, one hour thirty-two minutes,
    and the
  • 27:44 - 27:45
    number of seconds are going up, and you can
  • 27:45 - 27:46
    see there's some activity.
  • 27:46 - 27:50
    So can anyone think of anything that maybe
    we
  • 27:50 - 27:52
    use every single day, some of us, at least,
  • 27:52 - 27:54
    that lets you take verbs and nouns and combine
  • 27:54 - 27:56
    them in all sorts of interesting and powerful
    ways?
  • 27:56 - 27:57
    Anyone?
  • 27:57 - 27:58
    AUDIENCE: Language.
  • 27:58 - 28:02
    J.S.: L- well. All right. Someone over there
    is
  • 28:02 - 28:05
    a smart ass. A computer program that we use
  • 28:05 - 28:07
    every single day with verbs and nouns.
  • 28:07 - 28:08
    AUDIENCE: HTTP.
  • 28:08 - 28:13
    J.S.: HTTP is a good one, but no. I
  • 28:13 - 28:15
    was thinking of VIM. VIM. Let's hear it for
  • 28:15 - 28:21
    VIM. Yes. Exactly.
  • 28:21 - 28:23
    I would love to, I would love to find
  • 28:23 - 28:26
    out that, that the interface in VI was influenced
  • 28:26 - 28:28
    by the Apollo Guidance Computer. I don't think
    it
  • 28:28 - 28:30
    was. If someone happens to know, please let
    me
  • 28:30 - 28:32
    know. That would be awesome.
  • 28:32 - 28:34
    But a funny thing, by the way, is that
  • 28:34 - 28:39
    this interface was, was intended to be temporary.
    All
  • 28:39 - 28:41
    the, all the engineers said, well, we don't
    really
  • 28:41 - 28:43
    know what to build. But we'll build this thing
  • 28:43 - 28:44
    with these verbs and nouns and it's kind of
  • 28:44 - 28:47
    clever and, and we'll use that until we build
  • 28:47 - 28:50
    something better. And, of course, we now know,
    like,
  • 28:50 - 28:53
    if you want something to stick around forever,
    just
  • 28:53 - 28:55
    say it's temporary.
  • 28:55 - 28:58
    But it's cool that the astronauts were, actually
    became
  • 28:58 - 29:00
    very adept at this, and it actually functioned
    really
  • 29:00 - 29:02
    well. And the fact that we still use, you
  • 29:02 - 29:04
    know, something similar in VIM today, like.
    Raise your
  • 29:04 - 29:06
    hand if you use VIM as your primary editor
  • 29:06 - 29:08
    for all the code you write? Exactly. It's
    maybe
  • 29:08 - 29:10
    twenty-five percent of the people in the room.
  • 29:10 - 29:14
    So I just think that's really, really cool.
    Let's
  • 29:14 - 29:16
    see. What else have I got for you? We're
  • 29:16 - 29:18
    gonna go back to the slides here, but just
  • 29:18 - 29:23
    to say I'm Julian Simioni. I work at 42Floors.
  • 29:23 - 29:25
    You can Tweet at me there. I am a
  • 29:25 - 29:29
    pilot in real life, and it's really fun. Again,
  • 29:29 - 29:30
    another thing I was inspired to do by the
  • 29:30 - 29:33
    space program. And I would love to take some
  • 29:33 - 29:33
    questions.
  • 29:33 - 29:35
    OK guys. Thank you so much.
Title:
RailsConf 2014 - Software Development Lessons from the Apollo Program by Julian Simioni
Description:

more » « less
Duration:
30:00

English subtitles

Revisions