Fantasy author Brandon Sanderson claims that creative writing and programming use the same brain muscles.
This is founded on personal experience: Back in college, he would sneak into any classes outside of his major he found interesting, one of which happened to be a programming class. Every time he got home from that class to work on his stories, however, he found he couldn't. It felt like he'd used up all the mental energy for programming that he usually uses for writing. He also mentions that class was the only one that ever had that effect on him.
I first heard this story some time ago but after getting more into programming recently, it has been on my mind again. I'm curious about this claim that writing and programming use the same brain muscles.
Are these two activities truly similar in nature? If so, is it impossible to be a writer and a programmer at the same time? Or are these similarities merely perceived, based on the fact that both activities can be quite mentally exhausting?
Are writing and programming similar?
As it turns out, others have written about these similarities before. Senior programmer Craig Sefton notes parallels between creative writing and programming in two posts on simplicity and perfection. Both writing and code should be structured, organized, clear, and concise. Purple prose or "purple code" should be avoided. Perfecting your code is an important process and programmers can draw inspiration from how writers approach revision and editing. Researcher Laurissa Wolfram, too, wrote on how writing and programming are more alike than you think: Knowing when and where to look things up is more important than having everything memorized, for example, and both follow an iterative cycle of creating, feedback and improvement, and more creating. (Her piece on the beauty of interdisciplinarity is fascinating as well.)
When I asked around in some Discord communities I am active in, some of those who replied agreed that creative writing and programming are similar. Someone pointed out that programming is more about language than it is about math. Others disagreed, saying that programming felt much more intense or exhausting for them or that they could move back and forth between both because they approached them in different ways (e.g. building an app vs. pantsing a story).
To my surprise, there seem to be quite a few programmers who are also writers! One person attributed this overlap between writers and software engineers to the fact that the latter is a well-paid job with great perks (remote work, 4-day work weeks, etc.), giving people the necessary resources to be able to write.
Reasons aside, programming and writing seem to go together better than I'd originally feared. In this Reddit thread, quite a few people describe the similarities as pros instead of cons. One person even claimed to be able to switch between both activities helped them be more productive.
I don't get writer's block per se because when I hit a stopping point on one project (say a novel), I switch over to programming until I get over the block. The change in medium I found really helps with keeping productivity high.
Maybe there's no need to worry after all?
Side note on churn
This blog post by Yevgeniy Brikman points out another unexpected but interesting similarity: He finds that the ratio of raw materials to finished product in a book (of which he has written two and recorded the stats to prove it) is roughly 10:1 and similarly, the ratio of code churn to lines of code in mature software is also at least 10:1. He dubs this the "10:1 rule of writing and programming".
Good software and good writing requires that every line has been rewritten, on average, at least 10 times.
The same rule also seems to show up in film, journalism, music, and photography, which says something about how often a piece of (art)work needs to be reworked until it is considered "finished" or ready for release. Of course, I expect this differs between projects and also between creators.
Some brain science
Are these similarities just perceived? As it turns out, scientists are just starting to explore what happens in our brains when we program.
In a 2020 study, scientists at Johns Hopkins University have mapped the brain activity of expert computer programmers while they worked on code. It was revealed that most of the brain activity of these seasoned coders happens in the network responsible for logical reasoning. Generally, logical reasoning has no brain hemisphere preference but in this case, it always happened in the left hemisphere, which is favored by language. This pattern has been found consistently across people who code even though there are many different ways to learn and work in programming.
Yun-Fei Liu, a Ph.D. student in Johns Hopkins' Neuroplasticity and Development Lab, notes another interesting aspect.
It's especially surprising because we know there seems to be a crucial period that usually terminates in early adolescence for language acquisition, but many people learn to code as adults.
Next, they hope to determine whether learning programming is easier for the young, just like learning languages.
Concluding thoughts
As you might have guessed, I wrote this piece for purely selfish reasons. Last week, I started studying programming every day and had absolutely no energy for writing—hence no Friday post. I was worried programming would continue to swallow all my writing energy so I decided to investigate if practicing both at the same time was viable. Turns out that doing any mentally exhausting activity for 1-3 hours every day is… mentally exhausting. Who would've thought! It will likely take some time to make space for this new passion of mine and find a new balance.
Also, sometimes (rarely) I am just not in the fiction-writing mood. My writing has always been an expression of what interests me in the moment, a way to follow my curiosity. I rarely stick to one genre, setting, or perspective for long. I like to switch it up. This is part of why this Substack is called Occam's Lab—ambiguous so I can imbue it with the meaning that suits me on any given day.
This is considered bad practice for authors. You're told to stick to your genre, to not see-saw between fantasy and literary fiction, for example. As a content creator, too, you're told to 'brand yourself', to pick your niche and stick to it like glue. I'm curious about too many things to do that but I also believe that's what makes my writing more interesting.
Where was I going with that again?
Right. This week, I'm still interested in programming… so here's a piece about programming and creative writing.
My day job is software engineer :-)
Great article and very interesting analysis. I don't know the first thing about programming but I wonder if the creativity element comes into play. I imagine that programming probably involves a lot more creativity than people would readily assume. Interesting stuff!