Learn From Fairy Tales, Guy Steele Style

| 2 Comments | No TrackBacks

I love to listen to great developers talk about how they write software. If you like the same thing, then you should check out Coders at Work by Peter Seibel. Peter rounded up some amazing folks from the software development world to interview, like Jamie Zawinski, Guy Steele, Ken Thompson, Peter Norvig, and the ultimate shot caller himself, Donald Knuth.

I continue to find must-read passages in this book, like this selection from Peter's interview with Guy Steele. Guy Steele, of course, did hugely important work on Emacs, Scheme, Java, and Common Lisp. I love how he correlates the edge cases of fairy tales and software.

Guy Steele: And I think that the other problem is that people like to focus on the main thing they have in mind and not worry about the edge cases or the screw cases or things that are unlikely to happen. And yet it is precisely in those cases where people are most likely to disagree what the right thing to do is.

Sometimes I'll quiz a student, "What should happen in this case?" "Well, obviously it should do this." And immediately someone else will jump in and say, "No, no, it should do that." And those are exactly the things that you need to nail down in a programming specification of some process.

I think it's not an accident that we often use the imagery of magic to describe programming. We speak of computing wizards and we think of things happening by magic or automagically. And I think that's because being able to get a machine to do what you want is the closest thing we've got in technology to adolescent wish-fulfillment.

And if you look at the fairy tales, people want to be able to just think their minds what they want, waive their hands, and it happens. And of course the fairy tales are full of cautionary tales where you forgot to cover the edge case and then something bad happens.

Peter Seibel: Fantasia and the perils of recursion, of course.

GS: Fantasia and recursion, yes. Or, "I wish I was the richest man in the country" - well, that makes everybody else extremely poor and you're the same as you were before. That kind of thing happens in fairy tales because people forget that there's more than one way to do something. And if you just think about your main wish and don't think about the details, that leaves a lot not tied down.

PS: So the lesson from fairy tales is that the Gandalfs of the world got there by hard labor, learning the incantations, and there's no shortcut to that?

GS: Yeah.

I've never seen anyone make an analogy between these two bodies of work before, but we often do find ourselves creating software as if we were in the a fairy tale, paying little attention to what could go wrong. The entire book is loaded with great, insightful stuff like this. I encourage everyone to check it out.

No TrackBacks

TrackBack URL: http://www.codypowell.com/mt/mt-tb.cgi/7


Guy Steele may have got the wizard / magic analogy from his lisp background. Probably the most famous book on lisp is "Structure and Interpretation of Computer Programs" -- aka The Wizard Book. The analogy has been around since at least the 80s and probably longer.

The wizard/magic analogy dates back at least to 1975 and The Mythical Man-month by Frederick P. Brooks, Jr. who writes

Yet the program construct, unlike the poet's words, is real
in the sense that it moves and works, producing visible
outputs separate from the construct itself. It prints
results, draws pictures, produces sounds, moves arms. The
magic of myth and legend has come true in our time. One
types the correct incantation on a keyboard, and a display
screen comes to life, showing things that never were nor
could be.
....one must perform perfectly. The computer resembles
the magic of legend in this respect, too. If one character,
one pause, of the incantation is not strictly in proper
form, the magic doesn't work.

About the Author

The Art of Delightful Software is written by Cody Powell. I'm currently Director of Engineering at TUNE here in Seattle. Before that, I worked on Amazon Video. Before that, I was CTO at Famigo, a venture-funded startup that helped families find and manage mobile content.

Twitter: @codypo
Github: codypo
LinkedIn: codypo's profile
Email: firstname + firstname lastname dot com