Knight Center
Knight Center


Journalists’ beginner guide to coding

As the news industry continues to adapt, journalists are asked to expand their skills beyond sleuthing and writing and into programming. The romantic ideal of the hacker journalist finding the signal in the noise of the incredible amounts of data generated everyday has become one of the most intriguing developments in journalism in recent years.

Lots of journalists start out with hopes of creating the next Homicide Watch or Dollars for Docs but learning to code takes time and effort and many would-be hackers burn out quick, as Digg’s Jake Levin pointed out in a blog post earlier this spring. In fact, there are a surprisingly high number of articles dedicated to dissuading journalists from learning to code, despite calls for greater technical skills and specialization.

The most important thing many data journalism experts say is to remember it’s about telling the story first. Levin pointed out that actually building something first is a more valuable learning tool—and more fun—than programming for programming’s sake. Start with a specific project in mind and go from there.

Back to Basics

Check out this video tutorial on using spreadsheets in your reporting from the Steve Doig at the International Journalism Festival.

While the results are sexy, the process of coding isn't. Fortunately, one of the most basic data journalism tools is the lowly spreadsheet. Experts interviewed for the Data Journalism Handbook routinely listed Excel and Google Spreadsheets as some of the most commonly used tools in their daily operations. Microsoft Excel, for example, can handle files with up to 1 million rows and 16,000 columns so don’t doubt its ability to contribute to the heavy lifting on the data side of your story.

First steps

Once you’re familiar with spreadsheets there are lots of directions you can take your data-driven project without having to write any code. Google Fusion Tables lets you merge two spreadsheets or CSV files to visualize data in charts, graphs and even interactive maps. While it’s still in beta, Google Fusion Tables are regularly used by big names like the Guardian Data Blog for their visualizations.

Check out this run down of infographic and data visualization tools from the Knight Center for Journalism in the Americas if you’re interested in exploring this less code-happy side of data journalism.

You can also start exploring web scraping without a deep coding knowledge. Web scraping lets you glean information from websites with a certain amount of automation (in other words, not having to copy/paste every little thing you’re looking for). ProPublica assembled a ScraperWiki that has great resources for how beginners can start to scrape website and databases for information for their stories. A free web application for Chrome called Table Capture lets you quickly copy tables from websites and paste them into another spreadsheet. The Knight Center also assembled a collection of data scraping tools to unlock data trapped in PDF files.

Working with multiple spreadsheets you may have already run into one of the most time consuming aspects of data journalism—cleaning up messy data. Google Refine is another free program that unifies nomenclature across multiple spreadsheets. ProPublica also weighs in with their own advice on how to use Refine to clean up your datasets.

HTML, CSS and JavaScript

At some point, you’re going to have to actually learn some code. Remember Levin’s advice, building something can be the best way to learn. Create your own blog with WordPress or another service and get a feel for the HTML code as you customize it. Codeacademy is one of the most popular free online tutorials for learning to code JavaScript, HTML, CSS and other programming languages. Tuts+ also offers a free 30-day course on HTML and CSS

Since coding is so time consuming, there are lots of resources out there to help you avoid having to re-invent the wheel. Check out resources like jQuery to get access to interactive features for your blog or website.

Code Editors

If you’re ready to dive into something deeper, the first thing you’ll need is a code editor. NotePad++ is a free option for PC users and TextMate offers a free trial version for Mac users. Sublime Text is another recommended code editor for both Mac and PC.

Scripting Languages and Web Frameworks

Scripting languages make up the architecture behind news applications. Two of the leading ones in journalism are Ruby and Python. Web frameworks are used with these scripts to ease the coding process to access and manipulate data. Ruby developers use Ruby on Rails and Django for Python. Hackety Hack and offer Ruby tutorials and exercises. Google offers a Python class and The Django Book is a free e-book introduction to Python-based programming.  

Join a club

Finally, look for a professional organization that can connect you with other would-be coders. Hacks/Hackers organizes meet ups all over the world for developers, journalists and designers. 


Subscribe to our weekly newsletter "Journalism in the Americas"

Boletim Semanal (Português)
Boletín Semanal (Español)
Weekly Newsletter (English)
Marketing by ActiveCampaign