Coding for Journalists, Part 0: Why Code?

Learn to code, they say.

It’s advice that most of us have heard at school or in a newsroom, but that few of us ever really act upon.

And no, it’s not because we aren’t wired that way. We’re smart, adaptable people. The trouble with coding is that it’s so detached from what we know and what we’re good at. We’re writers, researchers, and reporters. That’s our trade. We don’t have the time or motivation to futz around with arcane syntax, any more than we have the time to learn plumbing. We’re just not interested. We’d rather be writing.

Advocates for teaching code like to go on about “digital literacy” and how important it is. They’ll tell you that you need to start learning code right this second because otherwise no one will hire you, ever, and, hey, you’re missing out, so-get-with-the-program-already. They mean well, but I’m not a fan of this line of reasoning. Not only is it condescending to call educated people illiterate for not possessing a skill outside of their field, but you won’t encourage anyone to step out of their comfort zone and learn something new by guilting them into doing it.1

Truth is, it isn’t necessary for the whole world to learn how to code. People in most professions can ignore programming entirely and not be any worse off for it. Not everyone needs to be make an app or be a badass hacker. There’s little point in code-for-code’s-sake, and less point in teaching programming to every single person in college or kindergarten, or whenever we’re supposed to have learned it.

That said, a certain kind of coding is useful for journalists who write on the web. And in 2014, that means pretty much all of us. That alone is a good enough reason to learn what practical coding is all about and how (and why) we should integrate it into our work.

Of course, that’s easier said than done. The online tutorials that exist are, for the most part, unhelpful and irrelevant. They’re out of date, teaching code and techniques that were current in the mid-00s or earlier. But even the good resources are geared toward developers and designers, not writers. They cover topics we don’t need to know about, and leave out others that we should. They don’t teach us how code can actually enrich our online writing and help us work more efficiently. (Most of us aren’t even aware that code can help us work more efficiently.)

Yes, it’s possible to code up flashy animations, interactive features, and data-stuffed bonanzas. But we can also use code on a smaller scale in our day-to-day writing. The goal of this series is to show you how.

Who is this for?

This series of posts is aimed at journalists and other kinds of writers. For that reason, it’s going to follow a different path from most “Intro to HTML” tutorials.2 You won’t learn how to build a website or app from scratch (although you could certainly go on to do just that), but you will learn languages, techniques and best practices that you can apply whenever you make content for the web.

Apart from code itself, we’re going to cover tools that can make you happier and more productive as a digital creator, such as version control, secure backups, and writing in Markdown. These topics are outside the scope of a typical web development course, but they’re incredibly useful for anyone who writes online.

If you’ve put off learning HTML at least a dozen times before, this is the series for you. If you know some web programming but begrudge having to use it, I hope I can change your mind. Code isn’t just a last-ditch resort for when WordPress is screwing up your formatting; it’s something you can learn to appreciate on its terms. That’s because it’s the simplest and most direct way of manipulating the web.

The idea is to go from “knowing” HTML to using HTML in a way that’s precise and effective. Like Miyamoto Musashi.

It’s true that getting to that stage takes some practice and time investment. But being able to work in code is worth it—not just for your resume, but to add to your personal arsenal of skills as a writer.

And if you’re already an HTML pro, stick around. You might still learn a thing or two.

What we’re gonna learn

No one who works in media needs any convincing that the web matters. In a few short years, the conversation has shifted from ‘digital” to “digital first” to “digital only.” For many of us, web has completely replaced pen and paper as our tool of the trade.

So we should probably have some idea how it works. Just as print journalists should know what happens between the time when a draft leaves their desk and the newspaper hits a doorstop, web writers should have a general understanding of the technologies that power the modern Internet. That’s why one aim of this series is to provide context by explaining things like what goes on behind the scenes in your CMS when you write a post.

But before we get that far, we have to start with the basics. That includes learning about HTML, CSS, and JavaScript, the trifecta of languages that make up the modern web. Of the three, HTML is by far the most relevant to writers, so we are going to spend many of these posts learning how to write it in a way that’s stylistically modern and clean. Afterward, we’ll talk about tools that can make writing code easier and more enjoyable—and come up with a web production workflow that you can use from your first draft right up until you hit “publish.”

The first tutorials may seem simplistic if you’ve studied HTML before, but it may be worth your while to skim them—especially if you learned HTML more than a couple years ago. The web is always changing, and web culture and technology changes with it. This series covers HTML5—the newest version of the venerable standard. It’s much like the earlier versions, but makes some important syntax and philosophical changes that affect even the most basic code.

We’ll start later this week with Part 1: Text Editing — Reppin’ It Old School

  1. Yes mum, I’ll get my driver’s license soon. Promise. I know it’s embarrassing that I’m 24 and I still don’t have it. OK, technically I had it but I let it expire. But that’s besides the point. I’ll get around to it. Next month. Maybe?

  2. For instance, I won’t bother explaining that HTML stands for “Hypertext Markup Language.” No one has called it that since 1993. Seriously.