Sunday (08/20/06)
Making Code Poetry Part I 9:00 pm
Code is Poetry. It’s a phrase found in WordPress’s footer that should be true but often isn’t. At 9rules somebody asked if code really is poetry–I say that not all code is poetry, but all code should (and can) be poetry.
In this multiple-part series I’ll be taking a look at some specific code examples and showing how to turn bad and/or ordinary code into something even Shakespeare would drool over. But before we can do that, we’d better see what poetry is and how code could possibly fit this definition.
Defining Poetry
First I checked dictionary.com for a definition, since that seems to be a pretty good place for definitions:
3. A piece of literature written in meter; verse.
4. Prose that resembles a poem in some respect, as in form or sound.
6. A quality that suggests poetry, as in grace, beauty, or harmony: the poetry of the dancer’s movements.
Not a ton of help, though “meter,” “form,” “grace,” and “harmony” tend to stick out. Now lets see what Wikipedia says:
Poetry (Greek ποίησις poesis, literally “creating”) is a form of art in which language is used for its aesthetic qualities, in addition to, or instead of, its ostensible meaning. Poetry has a long history, and early attempts to define poetry, such as Aristotle’s Poetics, focused on the various uses of speech in rhetoric, drama, song and comedy. Later attempts focused on the deliberate use of features such as repetition and rhyme and the emphasis on aesthetics to distinguish poetry from prose. Now a days contemporary poets, such as Dylan Thomas, often identify poetry not as a literary genre within a set of genres, but as a fundamental creative act using language.
Poetry often uses condensed forms and conventions to reinforce or expand the meaning of the underlying words or to invoke emotional or sensual experiences in the reader, as well as using devices such as assonance, alliteration and rhythm to achieve musical or incantatory effects. Poetry’s use of ambiguity, symbolism, irony and other stylistic elements of poetic diction often leaves a poem open to multiple interpretations.
Now that’s more like it. This applies to code as well–good code has visual form, is condense, “expands the meaning of the underlying words,” can be used with “multiple interpretations,” and is just plain good-looking. Call me a freak, but I can honestly say that I’ve looked at code before and thought, “Dang, that’s beautiful.”
Back to Code
When code is poetry, you can tell what’s going on within it by a simple glance. It’s resourceful, it’s inspiring, and it works.
The next part in this series will focus on visual form within code, so stay tuned. 
I eat food. I listen to music. I sleep. Sometimes. I drink lots of coffee. I make pretty pictures. I talk to people. I believe in things. I write stuff. I take photographs. I have a laughing addiction. I am human. 
“At 9rules somebody asked if code really is poetry–I say that not all code is poetry, but all code should (and can) be poetry.”
That ’somebody’ was me, and I was surprised at the amount of feedback I got. I was less surprised however, at the division amongst coders on the literal meaning of ‘code is poetry’; some clearly see it as a means to an end, whereas others, like Mr. Swan, are willing to push it into the realm of aesthetic appreciation. Either way it remains somewhat of a mystery to me.
I’m compelled to start learning code because I love messing with wordpress themes, I just understand what I’m actually doing.
Any tips on how to get started for a complete newbie?
Can’t be a better place to start than W3Schools, a good book on your language of choice, and some blogs (try technorati to find some on the said language).
[...] (Stay tuned for Part III which will focus on resourceful and condense coding. If you haven’t read Part I yet, you can catch it here: Making Code Poetry Part I.) [...]
Elliot! Your self-trackbacks don’t have gravatars!
[...] Time for the fun stuff. If you remember from Part I of this series, when we were checking Wikipedia for a definition of poetry we came across this little bit: Poetry’s use of ambiguity, symbolism, irony and other stylistic elements of poetic diction often leaves a poem open to multiple interpretations. [...]