Creative Computers: What the Overlap of Programming and Poetry Teaches us about Creativity

Writing programs in Python requires the sort of precision most of my writing doesn’t demand. A missing letter, an extra comma, or a poorly arranged phrase are more than just confusing; the smallest spelling mistake will stop the program completely. In Python, typing “print” will tell the program to print the characters that follow this command. Typing “Print” yields nothing. Computer Science is not so forgiving of my penchant for typos. Whenever I discover these small problems: the missing colon, the extra space, I want to shout, “it’s close enough!” But of course, the computer can’t “figure it out” the same way a human would. I don’t think I’m the only one who was initially repelled by this. The computer doesn’t act like a human. It doesn’t grasp nuances or appreciate aesthetics. Yet this is what others love about computers: the fact that they aren’t human. They don’t make human mistakes. They aren’t inconsistent or volatile. If the code is written correctly it will work. Every single time.

This precision may encourage the pretty prevalent fear that technology is taking over human roles. I’m sure some people welcome the idea of increased efficiency as much as others are afraid of being replaced. But this division doesn’t quite make sense. The capabilities and potential capabilities of computers reach far beyond anything we could do with a human brain alone, yet I still believe there are elements of emotions, creativity, and growth that technology cannot yet replicate. No one should think of humans and technology as opposing one another, because neither work alone. Those who believe we only learn best from paper books are rejecting the ability for technology to serve as an extension (and not a replacement) of human intelligence.  However, for technology to help us learn, we must approach it from this standpoint.  Using the label “Computer Science” allows us to forget how similar the process is to that of learning a new language, as well as how much more useful technology will be to humans if we approach computer science from a humanities background.

Each programming language, as unforgivingly precise as it may be, has a sort of musicality to it. The repetition of certain phrases is not unlike a refrain.  Much like how learners of foreign languages must adjust to unfamiliar syntaxes, coders develop fluency in these patterns.  Additionally, the required symmetry of code recalls certain poetic forms.  Rules like the logic of “if…then” statements or the required indents following colons demand a structure with its own internal logic.  The brain processes required to master this science are certainly similar to the process of learning a new language, or even understanding the format of a sonnet or villanelle in one’s own language.  Much as literature, the same program could be written in a variety of styles.  The diverse inner workings of similar programs can be visually stunning, sometimes even to those who don’t totally understand the language.

Once coders master the use of a programming language, they can add reflexivity to the experience by creating a program to play with the English language.  For example, haiku, a highly structured form of poetry involving three lines of 5, 7, and 5 syllables each, are easy to generate through computer programs.  A few years ago, when a friend and fellow Hamilton student created such a program, I was amazed by the beauty in some of these computer generated poems. How could we find meaning in these authorless works? Our reactions to the haiku were devoid of influence from authorial intent, because there was no author, in the traditional sense. Our ability to read meaning into the poem despite this fascinated me.  Here was a tangible example of how interpretation allows us to generate ideas. Reading these poems didn’t leave me in fear of being replaced by technology. Instead, it felt like an ultimate creative act. The text on the screen bore no intentions.  It was presented to me without any design beyond the syllable count. Yet in reading, we created meaning.

My friend’s program did not account for grammar, only syllable count.  The program chose either words or bigrams (sets of two words commonly used together) from a dictionary to fulfill the haiku pattern.  They say that art cannot be produced in a vacuum, but in a way, these were.  The combination of words were devoid of the literary and cultural allusions which permeate our literary cannon.   Perhaps the phrases that impressed me most in these haiku were only possible thanks to freedom from literary constraints.  Yet, at moments, the generated haikus did evoke familiar tropes and images.  Simply having a background in literature caused me to read these would-be nonsensical poems within that framework, for better or for worse.  This reminded me how much our ideas and experiences influence our everyday actions.  If I could draw connections from a string of random words, then much more of my experience must be filtered through this lens.  For me, finding meaning in these poems displayed how much my studies in the humanities have influenced how I understand the world around me.  Creating programs that play with words for us gives us a new way to explore the questions which literary theorists have been asking for years.

Later, I learned that creative writing and computer science fit together more often than I would have expected. Just as code can generate poetry, poetry can also generate code. At the Code Poetry Slam at Stanford, participants use code to create poetry.  The writers interpret this in a variety of ways, but the most impressive are those which are double-coded, meaning that they make sense in multiple languages at once: English and programming language.  Beyond simply incorporating the unique phrasing of html, python, or C++, these poems are dynamic.  They are legible in English, yet also prompt the computer to do something when the program is run.  From both sides, computers let us observe creativity in a new way.  We can observe the way our brains process information as well as the way they can make things happen.

To program without creativity should seem as ridiculous as penning fiction without imagination.  Even programs not related to poetry require creative approaches.  The computer is our tool; we shouldn’t use it blindly. We should use this tool with as much care and imagination as we would our pencils and paintbrushes.

-Lily K Marks, NY6 ThinkTank Student Fellow

Further Reading:

More about the haiku generator:

Examples of Code Poetry: