Writing Code Is Not Writing Words

So, I’ve been learning to code in JavaScript recently. Before that it was some basic jQuery. Before that it was CSS3. Before that it was HTML5. Wait, I learned some Bootstrap as well…where was that in the order? Sigh, I can’t remember. What I can tell you is this, writing code is not writing words.

It’s not that one is inherently harder than the other. Writing words is easier for me because I’ve had so many years of practice at it. Even if I didn’t, though, I still think writing code would be more challenging for me. Constructing sentences and scenes, deploying alliteration and cadence, these things come with a lot of wiggle room. I can fudge the math, so to speak, and play fast and loose with some of the rules.

That appeals to me, which makes me wonder if there isn’t a more adventurous, anti-authority rebel hiding deep down in my secret heart of hearts.

That wiggle room doesn’t exist in coding. There are almost always multiple paths to a solution, so there’s a little room for style, but you can’t fudge the math. The rules are absolute. Forget a punctuation mark, use the wrong kind of bracket, or forget to declare a variable and the whole thing implodes in an epic fail bomb. Do not pass go. Do not enjoy a working algorithm.

That said, I suspect it’s probably good for my writing to work in a system that is so unforgiving. Having to stay that conscious of the rules in coding has a bleed through effect. I’m simply more conscious of grammar rules and the rules of good writing. I’m also more conscious of the rules that I never really learned. I cannot, to this day, explain pluperfect tense. I’d be willing to bet that I use it in my writing, though.

(Side note: I looked up pluperfect tense, and I do use it in my writing. Most writers do.)

I think the bigger point here, and one I’ve made before, is that writing benefits from new experiences in obvious and subtle ways. That heightened consciousness of rules is a relatively subtle, but very helpful, benefit of my coding experience. The more obvious benefit is that I can now include real-to-life scenes about coding in my fiction.

I probably won’t, except in the most abstract ways, because coding is a lot like writing. It’s someone tapping away at a keyboard, which is difficult to make sound interesting on the page. What I can do now is get the emotional tenor right. I can talk sensibly about a novice coder’s emotional experience. (It’s mostly rage, punctuated by brief moments of relief and happiness bordering on hysteria.) As a writer, that information is worth its weight in gold.