To Code or Not to Code

A Playwright’s Guide to Thinking like a Developer (and when not to).

Jason Tseng
Jun 16, 2017 · 7 min read
This ASCII image of the Bard generated by

“The lunatic, the lover, and the poet, are of imagination all compact.”

— from “Midsummer’s Nights Dream,” Act 5, Scene 1 by William Shakespeare

For almost a decade, I’ve been working in one way or another in the arts and culture field where I’ve made a name for myself as a vocal advocate for disruptive transformation of the sector by shifting from being institution-centered to artist-centered. I spent years encouraging arts leaders to redistribute art-related investment out of large institutions and adopt anti-oppressive arts policy.

I’m also an artist, myself. I make plays, write thought pieces, draw comics and illustrations, and produce podcasts. However, I recently decided to take a hard left in my career and learn to code at the Flatiron School’s NYC Software Engineering Immersive program.

Many might look at this decision and wonder what a playwright is doing trying to be a software developer. Everything that popular culture tells us about coders is that they are highly technical, socially-inept, and obsessively logical; and playwrights are overly emotional, delicate artistes, that need to be sheltered from criticism. Surely the plasticity of art-thinking would be incompatible with the rigid logic of code-thinking. At least that’s what I thought.

Art Thinking vs Code Thinking

Before I loaded up my first Ruby tutorial (for the uninitiated: a programming language, popular in coding bootcamps for its legible and intuitive syntax), I assumed that to learn to code I would have to rewire the way that my brain worked. In my work as an artist, I relied heavily on my creative mind — a swirling chaotic symphony of ideas, images, and personalities.

The Creative Mind according to me. Illustrated by Jason Tseng. All rights reserved.

I think of it like a particle accelerator, smashing two, often unrelated, ideas together: rendering their component parts exposed and able to be reformed and shaped into novel and exciting forms. For example, my last play, Rizing, was a mashup of the zombie mythos and socially-oriented science fiction which I like to describe as The Walking Dead meets Octavia Butler.

This kind of free associative idea generation — which some have come to define as Art Thinking — is rooted in pursuit and exploration of a question and its subsequent answer(s), as opposed to Silicon Valley’s almost obsessive pursuit of a problem and its subsequent solution. At its face, these two kinds of thinking seem to be opposed to each other: art thinking focuses on process and exploration where code thinking focuses on results and efficiency — or so the thinking goes.

Coding like a Playwright

In the short time that I have spent learning to code, I have found the experience of coding remarkably similar to my experience making art. This makes a lot of sense to me —

in many ways, technology and art have the same basic purpose:

making real, the imagined.

When I write a scene in a play, I have a set of circumstances, events, and characters which I have received from prior scenes (or preceding action). Based on the larger plot arc of the play, I know that I have a vague sense of where I need the play to arrive by the end of the scene. So writing an individual scene constrains the infinite possibilities of the imagination to a handful of characters, what they might do with each other, and the things they say while they do it.

That being said there are still many ways that things that could happen in this small amount of time that will color or change the ultimate outcome of the play. Additionally, many of these options are more effective than others in terms of the audience’s experience —for example: humor, intimacy, violence; all will strike the audience in different ways, which ultimately effects the dramatic impact of a scene. As a playwright it’s my job to explore each of these instances — these possible versions — of my scene to determine which is the most effective.

Similarly, when I code, I don’t look at a problem in an entirely linear way. I know the ultimate desired outcome that the code is trying to achieve, but I view my process of coding as more of an exploration of the interior space of the piece of code that I am writing — rather than searching for the quickest way from point A to point B. Especially in my learning how to code, this inquisitiveness into the new types of objects and concepts that I am receiving has helped me immensely in gaining a greater familiarity and comfort in manipulating and shaping the tools at my disposal.

A practical example

One small way that playwriting helps me understand how code works is conceiving a block of code as a small play, with the various methods and arguments passed to it as actual characters in the scene.

Consider the following code:

dinner_party = [{name: "Harry", age: 35, occupation: "Lawyer"}, {name: "Dirk", age: 29, occupation: "Investment Banker"}, {name: "Sarah", age: 32, occupation: "Journalist"}, {name: "Kate", age: 19, occupation: "Student"}]occupation = "Journalist"def find_by_occupation(occupation, dinner_party)dinner_party.find do |guest|
guest[:occupation] == occupation

When I read this block of code, I see the setting (a dinner party), at which there are a collection of guests (the hashes which are elements of an array), and a question in the form of the variable “occupation.” I also imagine the method #find_by_occupation is a character, let’s call him Finn. Finn’s job is to go to this dinner party and ask each guest at this dinner party if they are a journalist. If one of the guest acknowledges that they are a journalist, Finn will bring this person to me, the audience.

How would this play out in a scene? Let’s find out! To the theater!

Go, Curtain! Go, Lights! Go, Music!
At rise: a small dinner party at the home of HARRY, a well-respected lawyer in Code City. Among the guests are DIRK, a wise-cracking and boastful investment banker, SARAH, a journalist who listens more than she speaks, and KATE, a sullen and morose college student. The guests mull over the hors d'oeuvres and wine while listening to a particularly rapacious jazz record.HARRY:
Isn't this the life? Good food, good people, good music?
Totally, Bro! Jazz rocks!
KATE: (aside to SARAH)
Jesus, does he ever stop talking? I bet he doesn't know the first thing about jazz.
Do you know the first thing about jazz? How old are you? 17?
I'm old enough to know that jazz doesn't "rock." Idiot.
On this we can agree...
Enter FIND_BY_OCCUPATION aka FINN, a mysterious fellow. He is dressed in a dark suit with a hat. He looks very official.HARRY:
Why hello, do I know you?
FINN: (gravely)
No. But I'm here on a mission.
Mission?! What kind of mission?
I've no time for your question! I must find a journalist. It's of the utmost importance. You there! (to HARRY) Are you a journalist?
No, but Sa--
How about you, good sir? Are you a journalist?
Nah, bro. I don't do words. I do dolla billz!
KATE cringes and rolls her eyes in the corner.FINN: (to SARAH)
Are you a journalist, ma'am?
I'm usually the one asking the questions.
So, you are?! Quick, follow me!
FINN grabs SARAH's arm and quickly runs out the door. They exit.KATE: (sullenly)
Well, there goes the life of the party.

Putting aside the (questionable) dramatic value of the scene, this is another way to understand more than just what the method does, but also why we should care. This of course is an exaggerated version of what goes on in the computer, and it definitely isn’t as efficient as simply saying “the method iterates over the array, finds the first element that returns true for the block, and returns the found element.”

But it’s a lot more memorable, dynamic, and you get a better sense for how to use the method in the future.

While there are definitely moments when I need to engage in more of code thinking — especially when I’m trying to solve a clear, concise problem. But more often then than not, taking the creative scenic route makes for a much more adaptive and novel approach to coding.

I’ll be blogging more about my journey from putting plays on the stage to staging development environments, and how theatre and art can help us understand coding concepts in a more intuitive and human way.

Undefined Methods

Adventures in Art, Theatre, and Coding

Jason Tseng

Written by

I write plays, comics, and code. #FlatironSchool

Undefined Methods

Adventures in Art, Theatre, and Coding

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade