Code && Literature: More Similar Than You Might Think

Clark Sanford
Oct 14, 2016 · 5 min read
Taken from http://sourcecodepoetry.com/

As an erstwhile literature major who recently enrolled in a coding bootcamp, I often get comments on my seemingly divergent choices of life path. People are confused — you studied literature, why would you switch to something so different? I always offer the easy, quick response — “I couldn’t find a job I wanted in literature and I’ve always been a very math-minded person” — but there is a longer answer.

This blog post is a random collection of thoughts in an attempt to answer this question, for others as well as for myself. Lacey Williams Henschel has written a very well-thought-out and articulate post on the same topic, so if you want something a little meatier go check out her article! This post is essentially just a collection of my own ideas on how learning the study of literary analysis and learning to code may not be as different as you think.

Don’t believe me? Stick around for the next few paragraphs and see if I’ve convinced you at all.

How is code like literature?

I love this quote from One Job, One Day explaining what literature majors are good at doing:

“English [or literature] majors are used to working with a wide array of information and vague criteria and striking out in a single direction with a precise argument. [They have an] ability to decide on a course of action based on varied or incomplete information…”

This quote has a lot of resonance for me, but not only from my experience writing essays in college. The first time I sat down to an empty text editor to write the code for a webpage and the first time I stared at a blank word doc contemplating a college paper I had to write were strikingly similar. In both instances, you’re creating something crazily huge and complex out of nothing, relying in part on whatever limited outside information you have, but mostly on your own imagination and creativity. This is what makes both literary analysis and code so hard, but so exciting! The world is your oyster, the empty text editor your blank canvas. But it’s all on you to come up with your own unique thoughts and find ways to express them.

Which leads me to my next point of rumination: learning code is like learning a new language. After nearly a year of self-learning, I have gotten to a pretty solid level in Javascript; and nevertheless, when we looked at the jQuery documentation in the second week of my coding bootcamp, it was like looking at something in Chinese — or, more aptly, like the time I tried to read Don Quixote after only having a few semesters of Spanish under my belt. The study of coding and literature are each studies of systems of meaning and the ways symbols can be manipulated; seeing a massive work in a language you still only barely grasp leaves you lost in a maze of unfamiliar words and alien-looking signifiers.

Learning code requires thinking with a new syntax; you are communicating with the computer and you have to get on its level (well, depending on the language you use, you are likely still not on the computer’s level…but closer, anyway). The first time I did a tutorial in Javascript, I thought, “How in the world do all the things on the web happen with only this limited number of operators!?” Loops, logic statements, arrays; it all felt so linear and disjointed. How could the fluid, flowing experience we (usually) have of technology come out of these clunky, piecewise pieces of code?

I’m still a bit baffled by coding language logic, but find it beautiful when you’re able to make these inflexible languages do flexible things. It is similarly amazing when authors can create complex meaning with nothing more than the simple words and sentence structures we use in everyday language. The words “rose,” “name,” and “sweet” are not particularly striking, but combining them together in a specific way — “A rose by any other name would smell as sweet” — generates an entirely different realm of expression.

Code Poem by Greta Kikilaite taken from http://sourcecodepoetry.com/

There’s no question that code requires extreme attention to detail; one misplaced semicolon could cause an entire program to break. And in literature, when writing a massive research paper analyzing works in different languages and tying together complex ideas, you still have to pay the utmost attention to your own grammar and spelling, to correctly placing every little period and comma.

In an even broader sense, both code and literature require a strong understanding of how small details matter within a larger context. When you’re doing a close reading, you’re always basing an argument on a very short piece of text. This means you have to really dig into the details and draw out whatever meaning they may hold. The ultimate goal, however, is to make a more meaningful argument within some kind of broader context. So you are constantly involved in a dialectical back-and-forth between little details and the overarching “big picture.”

Similarly, you have to be careful when defining variables and setting up functions in code. If you accidentally mistype the name of a variable, or try to access it outside of the scope in which it has been defined, it simply won’t work. As projects grow bigger, you need to be able to understand the significance of even the smallest piece of code and how it contributes to the overall functioning of your program.