Joe Armstrong
216
Occasionally I have to do very small experiments—write extremely small
programs just to answer some question. And then I think through things and
they more or less work as I expect when I program them because I’ve
thought through them. That also means it takes a long time. A program that
you write, you get the insight, you rewrite—it might take you a year to
write. So I might think about it for a year instead. I’m just not doing all this
typing.
That’s the first thing. The second thing that’s happened is intuition. When I
was younger, I would do the all-night hacks, programming to four in the
morning and you get really tired and it’s macho programming—you hack the
code in hour after hour. And it’s not going well and you persevere and you
get it working. And I would program when the intuition wasn’t there.
And what I’ve learned is, programming when you’re tired, you write crap
and you throw it all away the next day. And 20 years ago I would program
although I was getting a strong feeling that this isn’t right—there’s
something wrong with this code. I have noticed over the years, the really
good code I would write was when I’m in complete flow—just totally
unaware of time: not even really thinking about the program, just sitting
there in a relaxed state just typing this stuff and watching it come out on the
screen as I type it in. That code’s going to be OK. The stuff where you can’t
concentrate and something’s saying, “No, no, no, this is wrong, wrong,
wrong”—I was ignoring that years ago. And I’d throw it all away. Now I
can’t program anymore if it says, “No.” I just know from experience, stop—
don’t write code. Stop with the problem. Do something else.
Because I was good at math and that sort of stuff at school, I thought, “Oh,
I’m a logical person.” But I took these psychology tests and got way high
scores on intuition. And quite low scores on logical thinking. Not low—I
can do math and stuff; I’m quite good at them. But because I was good at
math I thought science was about logic and math. But I wouldn’t say that
now. I’d say it’s an awful lot of intuition, just knowing what’s right.
Seibel: So now that you spend more time thinking before you code, what
are you actually doing in that stage?
Armstrong: Oh, I’m writing notes—I’m not just thinking. Doodling on
paper. I’m probably not committing much to code. If you were to monitor