Programmers and writers are much alike.
Programmers are writers: they write code for the machines and team members to read. And writers are programmers: they write programs (stories) for the human mind to execute.
What are some techniques and ideas that programmers have found to be useful in their daily work? And can writers apply the same things in their craft?
Strive for efficiency
Programmers crave efficiency. Removing useless work and waste gives them immeasurable pleasure. If a program can be written in 5 instead of 6 lines of code, they will bend the code to fit on 5 lines, even if it means spending an extra day rewriting hundreds of lines of code elsewhere.
Next time you meet a programmer who hasn’t slept nor washed for days, try to understand that he is not so much different from James Joyce, struggling to find the perfect order for seven words that he wrote during the day.
Learn touch typing
Fingers play a big role in writer’s life. Sometimes, they get in the way, they can’t keep up with the creative flow that is oozing out of the brain.
Programmers, in their journey to eradicate all inefficiencies (not only in their code, but also in their craft), have learned to appreciate the value of touch typing. Even though they have also understood that typing faster doesn’t lead to better programs, and less code is often better—they still advocate for touch typing.
If you don’t know how to touch-type, it’s not a problem. This can be fixed with a little practice. Don’t handicap yourself by not learning the proper technique.
Touch typing is an essential skill for any self-respecting writer. Yes, you already can type fast with your two-finger technique, but you do it in a half-assed way. It’s not efficient. You are wasting vast amounts of energy on suboptimal movements. You are depleting the energy that can be used for creative thinking. But it’s not too late. With some training and learning about the basic principles of touch-typing, you can elevate your skill to a next level1.
Learning to touch type is also good for your health. Programmers know it. Learning to type properly will make you more conscious about your posture and can prevent some injuries (yes, you can get injured while writing your next novel).
So, next time your programmer friend is buying a $2000 ergonomic chair, and a $500 keyboard, don’t be surprised. He cares about his health.
Even Hemingway understood the importance of ergonomic work environment. Here you can see him working behind a standing desk.
Hemingway at work. Source: https://i.imgur.com/DxisUxy.jpg
The craft of text-editing
A text editor is for a programmer like pencils, colors, and brushes are for a painter. Programmers learn to use one tool very well, and swear allegiance to it2.
Mastering one text editor has many advantages:
You learn all the important shortcuts. This, again, increases your efficiency.
You don’t have to use a mouse to select the text, meaning, you don’t have to waste time lifting your hand away from the keyboard to grab the mouse. Selecting, cutting and pasting—everything can be done from the comfort of your “home row”3.
For programmers, extra movements are unacceptable. Instead of deleting one character at a time, they delete the whole word. Instead of deleting a word backward—as every other normal person does—, they will delete it forward if the cursor happens to be in the beginning of the word.
Programmers jump around the text so fast that you don’t even understand what is going. They have become one with the text editor. It’s imprinted into their muscle memory. Programmer’s hands will execute commands without conscious thought, freeing up mental processing resources for important thinking.
Embrace one text editor, use it every day, and keep learning new ways to edit the text. Soon your hands will memorize the shortcuts and the editor becomes a natural extension of your brain.
The best example of sticking to one editor is George R.R Martin (author of Game of Thrones). He still uses a long-forgotten word processor called WordStar 4.0. It was released in 1984. Let’s hope this is not the reason he writes so slow.
Image source: Text processor for writers. Source: https://arstechnica.com/information-technology/2017/03/wordstar-a-writers-word-processor/
Make it work. Make it right. Make it fast.
Programmers understand that they can’t just write a complete program from scratch. Too many variables. Usually, they don’t even know what the program is supposed to do yet. They will figure it out while writing the program.
Writers have the exact same problem when facing a blank page. Luckily, programmers have figured out how to beat it.
The first step is to “make it work”. This means writing a program that compiles, executes, and gives you a semi-correct answer. By writing the bare minimum, they have overcome the blank page syndrome, and got some understanding of what that program is supposed to do.
Now, they take the next logical step and make it right, rewriting and deleting a bunch of code, because most of it was crap anyway (ring any bells, writers?). The first step was just a discovery process, second step is making it right—make the program do what it’s supposed to do.
And the last step is to make it fast. If a program is doing the right thing but is unbearably slow, nobody will use it.
The same concepts can be applied to writing.
Make it work. Write the first version to understand what you are trying to communicate. Even if you think that you already know your topic and have everything planned out, once you start writing, you might end up going in a different direction.
Make it right. After completing the first step, you should have a good idea what it is that you want to say. Now is the time to say it. Restructure, rewrite, revise. Make it right.
Make it fast. Remove the clutter. Rephrase the sentences. Do whatever it takes to make your writing clear and coherent.
Some other noteworthy things writers can learn from programmers
Single responsibility principle. Each function in the code should do only one thing—it has a single responsibility. In the same way, a paragraph can be thought of as a function. Make it do only one thing.
Inlining code — Make your sentences longer, not shorter.
Commenting things out — Don’t just delete your text, cut it out, and use it somewhere else.
Concurrent programming — Having multiple storylines in your next novel? Well, be sure to reference concurrent programming textbooks.
There are many more things programmers can teach writers. But they are not flawless. Like writers, they procrastinate a lot, sometimes productively by working on their pet projects.
"I would rather write programs to help me write programs than write programs."4
Learning to touch type is an interesting process in itself. Commit to 15 minutes a day, and you will start to see results instantly. You will notice how your hands are slowly adapting to a new way of doing things. At times, you seem to lose the ability to type at all; every key you hit is a miss. But that is part of the learning process. Once the muscle memory kicks in, you are left wondering — how do the fingers know where to go?
Programmers are loyal users of their tools. They don’t care how old the tool is, or how bad it looks like. Some of the text editors (Vi and Emacs for example), go as far back as 70s and 80s. I’m not suggesting you to go and pull out your grandmother’s old typewriter. Actually, as writers, we use even more ancient technology—writing by hand.
Home row is a term used to describe the keys “asdf” and “jkl;”. Your four fingers comfortably rest on the home row. A finger will lift up (while the rest of the fingers stay on the home row) and hit the key that is assigned for it. For example, a left index finger, will press f,g, t, c, etc.
Floyd, R. W. (1979). The paradigms of programming. Communications of the ACM, 22(8), 455–460. https://doi.org/10.1145/359138.359140