Add to Technorati Favorites

Alter Egos - I Am Done Watching This

When clicking on an Alter Egos in the sidebar, please look above this title for video content.

Monday, September 25, 2006

The Poetry of Programming - Writing Code and Writing Poetry are Similar

Dead Beat has a friend he wants you to meet. They get together and talk software. Well Old D.B. is a little partial to computer programming - it's form and its creativity. And then Richard Gabriel ambles along.

Richard is a Distinguished Engineer at Sun Microsystems, where he researches the architecture, design, and implementation of very large systems, as well as development techniques for building them. He is the author of three books: Writers' Workshops and the Work of Making Things, Patterns of Software, and Performance and Evaluation of Lisp Systems.

He received his Ph.D. in computer science from Stanford in 1981 and returned to school to get a Master's in Fine Arts in poetry in 1998 at Warren Wilson College.

You see Old D.B. got his Degrees first in Math and Design Engineering before returning to school to get a MFA in Creative Writing too.

Indeed Dead Beat has for many years been contemplating the use of software to advance our understanding of writing technique. And then gosh darn it Richie takes the lead. Anyway I caught up with him being interviewed recently, have a listen:

Q: You have advocated a program that offers a Master of Fine Arts in software, similar to programs that offer MFAs in creative writing. You say, "Traditions of computer science and software engineering have tried to turn all aspects of software creation into a pure engineering discipline, when they clearly are not. The MFA in software would begin to repair this error." Tell us about the philosophy behind this proposal.

A: Writing software should be treated as a creative activity. Just think about it -- the software that's interesting to make is software that hasn't been made before. Most other engineering disciplines are about building things that have been built before. People say, "Well, how come we can't build software the way we build bridges?" The answer is that we've been building bridges for thousands of years, and while we can make incremental improvements to bridges, the fact is that every bridge is like some other bridge that's been built. Someone says, "Oh, let's build a bridge across this river. The river is this wide, it's this deep, it's got to carry this load. It's for cars, pedestrians, or trains, so it will be kind of like this one or that one." They can know the category of bridge they're building, so they can zero in on the design pretty quickly. They don't have to reinvent the wheel. But in software, even with something such as Java 2, Enterprise Edition or the Java implementation (or almost any of the APIs we define), we're rolling out -- if not the first -- at most the seventh or eighth version. We've only been building software for 50 years, and almost every time we're creating something new. If you look at software developers and what they produce, if you look at their source code, the programs they make, and the designs that they end up creating, there is real variability. And some people are really good and others are not so good.

So, because you can program well or poorly, and because most of it is creative (in that we don't really know what we're doing when we start out), my view is that we should train developers the way we train creative people like poets and artists. People may say,"Well, that sounds really nuts." But what do people do when they're being trained, for example, to get a Master of Fine Arts in poetry? They study great works of poetry. Do we do that in our software engineering disciplines? No. You don't look at the source code for great pieces of software. Or look at the architecture of great pieces of software. You don't look at their design. You don't study the lives of great software designers. So, you don't study the literature of the thing you're trying to build. Second, MFA programs create a context in which you're creating while reflecting on it. For example, you write poetry while reading and critiquing other poetry, and while working with mentors who are looking at what you're doing, helping you think about what you're doing and working with you on your revisions. Then you go into writers' workshops and continue the whole process, and write many, many poems under supervision in a critical context, and with mentorship. We don't do that with software.

I was talking to Mark Strand, who is one of the first poets who mentored me, and he said, more or less, that how good you are depends on how many poems you've written in your life. About two and a half years ago, I started writing a poem a day, and I've gotten way better since I started doing that. And so, I've probably written about 1000 poems in my life so far, almost all of them in the last two years.

Compare that to how many programs someone has written before they're considered a software developer or engineer. Have they written 1000? No, they've probably written 50. So, the idea behind the MFA in software is that if we want to get good at writing software, we have to practice it, we have to have a critical literature, and we have to have a critical context. It looks like we may be able to start a program like that in the next year or so at a major university that I'm not free to name. It's probably going to be called a Master of Software Arts.

Q: You wrote a poem called "Unnormalized Models" that seems to be about software, with a slightly personal touch thrown in towards the middle.
A: "Unnormalized Models" is sort of a found poem. A lot of it is taken from an abstract from a talk I attended about certain types of reasoning in artificial intelligence systems. It takes a left turn in the middle in the parentheses through the use of dissociation or association.

Q: Has writing poetry influenced the way you write code?

A: Writing code certainly feels very similar to writing poetry. When I'm writing poetry, it feels like the center of my thinking is in a particular place, and when I'm writing code the center of my thinking feels in the same kind of place. It's the same kind of concentration. So, I'm thinking up possibilities, I'm thinking about, well, so how do I reinvent the code, gee, you know, what's the simplest way to do this.

I'm thinking about things like simplicity -- how easy is it going to be for someone to look at it later? How well is it fulfilling the overall design that I have in mind? How well does it fit into the architecture? If I were writing a very long poem with many parts, I would be thinking, "Okay, how does this piece fit in with the other pieces? How is it part of the bigger picture?" When coding, I'm doing similar things, and if you look at the source code of extremely talented programmers, there's beauty in it. There's a lot of attention to compression, using the underlying programming language in a way that's easy to penetrate. Yes, writing code and writing poetry are similar.

I have given a keynote called "Triggers and Practice." In writing, a trigger is something that enters your mind and causes you to start a poem, or a story, or whatever you want to write. The trigger could be a scene, a line, an image that comes to you, or just something remembered. The poet Richard Hugo believes that all writing is creative writing in that you don't know what's going to appear on the page until you write. All writing relies on triggers where you write something and respond to it.

No comments: