JyriAnd Blog

What Writers Can Learn From Programmers

Programmers and writers are much alike. Programmers are writers: they write code for the machines and team members to read. On the other hand, writers are programmers: they write programs(stories) for the human mind to consume. But most of the time, writers and programmers live in separate worlds, struggling with the same problems.

In this article, I will write about some techniques and ideas that programmers have found to be helpful in their daily work. If you find any topic interesting — highlight it. That way, I will know what subject can be turned into a longer article.

Strive for efficiency

Programmers are all about efficiency and removing any useless work. If a program can be written in 5 lines instead of 6, they will take their time and rewrite it to 5 lines. If they are using the same action multiple times, they will bind it to shortcut. If the Ctrl button is in uncomfortable position, they will move it(I have switched Ctrl and Caps Lock).

Running Fail

That’s how typing feels like. Source: ohmagif.com

This can be fixed with little practice. Don’t handicap yourself by not learning the proper technique. Touch typing is an essential skill for a writer. Yes, probably you already do it in a half-assed way, and you can get a pretty good typing speed. But is it efficient? With training and learning about basic principles, you can elevate your skill to a next level.

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 touch type, 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?

Learning to touch type is also good for your health. It will make you more conscious about your posture and can prevent some injuries(yes, you can get injured if you write too much with a bad posture.)

The craft of text editing

A text editor for a programmer is like pencils, colors, and brushes for a painter. They learn to use one tool, and learn to use it very well.

Text Editor

My editor of choice is Emacs

Programmers are learning all the shortcuts that will help them to minimize the use of a mouse because touching a mouse means removing your hand from the keyboard. This extra movement in 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 is in the right place. They can jump around text so fast you don’t even understand what is going. So, what is going on?

Programmers have become one with the text editor. It becomes so much a part of the muscle memory that they don’t even have to think about it anymore. The hands will execute commands without your conscious thought. That frees up mental processing resources that you can use to think.

So, embrace one text editor, use it every day and keep learning new ways to edit the text. Soon your hands will memorize all the shortcuts and the editor becomes a natural extension of your brain.

The best example of sticking to one editor for life 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.

WordStar Text processor for writers. Source: https://arstechnica.com/information-technology/2017/03/wordstar-a-writers-word-processor/

Writing scripts for mundane tasks

If a programmer has done something more than two times, he thinks about automating the task. He opens his beloved text editor and writes a chunk of code that will do the same thing that he just did. Next time he will run the script instead.

If you find yourself doing the same actions over and over again, it might be a good idea to learn a simple scripting language. Python is particularly friendly and good language for a novice. If you prefer not to learn programming, most operating systems(Windows, macOS, Linux) provide you with tools, that can help with the automation. Also look up services like Zapier and IFFFT that will give you powerful platform to automate your online work.he

Ergonomic environment

Writing code for 8 hours a day can be hard for your body and mind. Sitting down is not a natural posture. Studies have found that sitting for prolonged times(be it behind a desk or driving) can have the same impact on your health as obesity or smoking. Writers are no different from coders. Most of us sit behind a desk while writing and editing.

Do yourself a favor and buy a standing desk and a good chair. While working, alternate between sitting and standing positions. If you own an Apple Watch, it will remind you to stand up if you have been sitting for too long. The idea is not silly as it seems, even Hemingway did it. He was one of the writers who couldn’t sit because of his back problems.

Ernest Hemingway typing

Hemingway at work. Source: https://i.imgur.com/DxisUxy.jpg

When you have to sit down, you better sit in a comfortable and ergonomic chair. True, good ergonomic chairs can cost a lot. But this chair will last you a lifetime. If you don’t know where to start looking, check out a classic Aeron chair from Herman Miller. Buy a used one, if you can’t afford a new one.

Let’s switch gears, and move from tools to thinking principles.

Make it work. Make it right. Make it fast.

You can’t just write a complete program from scratch. Too many variables. Usually, you don’t even know what the program is supposed to do yet. You will figure it out while writing the program.

The first step is to “make it work”, meaning — write a program that compiles, executes, and gives you a semi-correct answer. By writing the bare minimum, you will figure out, what actually needs to be written.

After you have a minimal working program, you should have a pretty good idea what the program should be actually doing. Now, take the next step and make it right. You will rewrite a lot of code, and every so often you are better off deleting everything and starting from scratch. First step was just a discovery process, second step is making it right.

Last step is to make it fast. If a program is doing the right thing but is unbearably slow, nobody will use it. But you can’t make it fast before you have made it right. And you can’t make it right, before you have made it work.

The same concepts can be applied to writing.

  1. Make it work. Write the first version to understand what you are trying to write. You might think you have everything planned out, but once you start writing, you might end up going in a different direction.
  2. 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.
  3. Make it fast. Remove the clutter. Rephrase the sentences. Do whatever it takes to make fast.

Single responsibility principle

Programmers don’t write code for themselves. Other programmers read and modify the code as well. It’s important to follow some principles and best practices resulting in clean code — code that can be easily read and modified, without worrying that it will break something, or be misunderstood by other programmers.

Single responsibility principle does just that. It advises writing atomic functions. Let me explain. A single program consists of many functions. Every function in the program should be doing only one thing. It has a single responsibility(reading a file, or writing an output to a screen, but not both things). If it’s doing more than one thing, it can be separated into multiple functions that do only one thing.

This principle could be applied to writing as well. For example. An article consists of many paragraphs(functions). Each paragraph should do only one thing. If it does more than one thing, cut it into two paragraphs. This is the single responsibility principle in a nutshell.