Should Writers Learn How to Code?

5 min read
  • Languages like HTML and CSS allow you to directly influence how your websites, newsletters, or e-books look.
  • Regular expressions and Markdown make your writing and editing processes more efficient.
  • Python is an actual programming language that you can use to automate parts of your workflows.

Writers are not the first group of people that come to mind when thinking about coding. Even though they’re surprisingly tech-savvy, writing code is just not the same as writing prose. But there are compelling reasons to learn how to code. Writers benefit from more freedom in publishing and more efficient writing and editing routines.

HTML: The web’s building blocks

HTML is the Internet’s mother tongue. Almost everything you see online was built in HTML. It’s the underlying architecture of websites, newsletters, emails, and e-books.

HTML is no programming language, it’s a markup language. The only thing you can do with it is declaring that one element be a list or another one be a paragraph (or a heading, a quote, an image, …). HTML doesn’t make the web more beautiful, it doesn’t provide any means of styling (that’s what CSS is for). But it makes sense of the web syntactically. And that’s why it’s so important.

Learning HTML empowers you to create your content without relying on content management systems or WYSIWYG editors. Even if you use such tools, knowing the basics of HTML lets you at least edit the code directly in case anything goes wrong (which often happens, as anyone who set up a newsletter can attest to).

CSS: Express your own style

If you want to take it one step further, learn CSS. It’s what makes websites and newsletters beautiful (or hideous). CSS allows you to deeply edit your website’s design and overhaul it completely or adjust only little details.

Especially if your website is based on a pre-made theme, chances are it doesn’t display your content perfectly. Maybe something breaks, or you’d like to present it differently—knowing your way around CSS lets you solve all those problems on your own. No web designer necessary.

Regular Expressions: Search supercharged

As a writer, you have to search (and replace) within your texts a lot. However, just searching for words and phrases has its limits. Sometimes you’re looking for a couple of very specific occurrences, but instead of finding them, 159 results light up.

Regular expressions are sequences of characters that make up a search pattern. They allow you to search for ultra-specific terms in all of your texts. For example, you can use regular expressions to search for email addresses or URLs, or only for words followed by a number.

But that’s not all: With regular expressions, you can even use parts of the search pattern within your replacement pattern. That makes it easy to rearrange repetitive parts of your text. Regular expressions look complex, but they’re, in fact, quite simple. It just takes some time for your brain to learn how to read the unusual patterns.

Python: Automate your workflows

Until now, we haven’t covered a single programming language. Neither HTML and CSS nor regular expressions have anything to do with actual programming because they lack logic.

Python, however, is a programming language. It enables you to create if-then structures and loops and functions. Everything a proper programming language can do. But what can you as a writer use it for?

Typically, Python is used for machine learning or data science. But Python is also a great programming language for beginners. You don’t need to write full-fledged applications with it, you can use it to automate your writing process. If you combine it with an app like Alfred or Keyboard Maestro, you can even create your own workflows and macros, available through a keyboard shortcut.

Python scripts can be as simple as automatically formatting your headlines in news style (“headlinese”) or as complex as a grammar and style checker. Python is easy to learn and can save you plenty of time better spent writing.

Markdown: Formatting with the keyboard

Markdown is no programming language, and you would be right to not even call it code. But for many people, its syntax looks like code. Markdown allows you to format your texts with symbols that you type instead of having to grab your mouse and click a button.

Need a phrase to be bold? Surround it with two asterisks on each side. Want to create a list? Start every line of a new paragraph with hyphens. Markdown works in every plain text file, and you’ll learn it quickly. Most of its syntax is quite intuitive and straightforward. If the other languages (or expressions) scare you, get started with Markdown and work your way up.

If you’ve never done any coding in your life, it might feel overwhelming to begin with it now. But coding is a logical approach to problem-solving. And it can solve many of your writing-related problems without the help of web developers or IT personnel. Give it a chance to make your life easier.