Guy Steele
371
represent data in compressed forms to get it to fit in the calculator. I
wouldn’t want him to spend his whole programming career that way, but I
think it was a useful experience.
Seibel: Back to code beauty—that kind of haiku, origami programming is
beautiful for the reason that any intricate little thing is beautiful.
Steele: Yes. But I should emphasize that that piece of Gosper’s code is
beautiful not only because you can compress it in this way—one of the
reasons it’s so small to begin with is because it’s based on a beautiful
mathematical formula, a triple angle formula for the sine function. And that
recursion can be expressed very concisely on this particular architecture
because that architecture was designed to support recursion in a way that
other machines of its day weren’t. So there are several different aesthetics
melding together, combined in this one routine.
Seibel: You also mentioned Knuth’s TeX, which is obviously a much larger
program. What is it that makes that program beautiful?
Steele: He took a very, very complicated program with lots of special cases
and reduced it to a single, very simple paradigm: sticking boxes and glue
together. That was an immensely critical breakthrough. It turns out to be
flexible not only for typesetting text but for all manner of other things as
well that have to do with laying things out visually, two-dimensionally, on a
page. I wish that more GUI interfaces were based on boxes and glue for
laying out buttons and things like that.
Seibel: So there is beauty to be appreciated once you understand what
boxes and glue means, you can say, “Yeah, that’s a deep and righteous idea
and I appreciate the beauty of that and see how it would apply outside this
one program.” Is there further aesthetic quality that you get—and can only
get—by reading through the source code and seeing how that theme plays
out? Or is it more that you read the whole thing and then at the end you
say, “Wow, that was really all based on this one simple, but not simplistic,
idea.”?
Steele: It’s a combination of those. And Knuth is really good at telling a
story about code. When you read your way through The Art of Computer
Programming and you read your way through an algorithm, he’s explained it