How I Learnt to Code in One Year
January 2, 2013 (updated on October 8, 2016)
The year is over and the progress bar of my #CodeYear is at 100%. On a scale for journalists, I can now code. On a scale for programmers, I can, well, nothing. This big picture view is important, but not discouraging. On the contrary.
When I started my quest, my goal was not to apply for an engineering job at Facebook. I wanted to broaden my horizon as a journalist, unlock new possibilities and simply learn something new. That’s why I will state confidently: It was worth the effort. Learning how to code is rewarding, I recommend doing it. At the same time, my answer to whether journalists should be able to code has become more nuanced. More on that later.
This article aims to document how my CodeYear went, to highlight difficulties and to record key learnings – hoping to encourage fellow journalists to give it a try themselves.
On August 8 2011 I publicly announced that I will learn to code. What I had on my track record: decent skills in HTML and CSS and a knack for maths and logic (if none of this is true for you, nevermind, these skills didn’t prove prerequisite). I had two main problems.
- What’s the best way (for me) to get going?
- What’s my goal, anyway?
The web does not offer too few options for beginners, but too many. I read through some tutorials, bought a copy of «Java Script: The Definitive Guide» and completed a few dozen video tutorials at Treehouse. None of which really did the trick for me. The book was too abstract for the bloody beginner I was. In the Treehouse courses, I got the feeling I can easily pass them without thoroughly understanding the matter. Most importantly, though: I still did not have a well-defined goal that would pull me forward.
The solution to both my problems came when, at the end of 2011, online learning platform Codecademy launched #CodeYear. It provided me with a goal (not an explicit one, but I could trust on someone else to define it for me), a structured curriculum (weekly courses) and the hope not to be alone in this (yes, I’m looking at all you fellow journalists who tweeted you’re all in for CodeYear).
Kicking Off #CodeYear
Codecademy makes it easy and fun to get started. You read short instructions and get coding right away in the editor. You are guided into this new world step by step, while you already feel like you’re right in the middle of it (because you don’t read or watch video tutorials, but write actual code right from the beginning).
Each course consists of three to six lessons, each of which again is subdivided into four to eight coding exercises. The steps are small enough for you not to feel overwhelmed, yet at the end of each week’s course you have coded something decent that feels like progress (the virtual badges that you earn as you go along do their bit, too). Especially if you have a daily job, you’ll appreciate the small steps, as they allow you to stop and take up again almost any time.
And Then It’s a Pain
You can see from the list of my badges: I gave up at the end of January. One reason was that it takes a lot of discipline to carve out two or three hours every week to sit at the computer and fill lines with cryptic language (especially if you work full time).
But the main reason for my surrendering was a different one. Learning how to code differs from learning a foreign language in one crucial aspect: Computers are bloody inflexible and merciless. Close a }-bracket at the wrong place, forget one single semicolon and communication fails.
The weeks after my initial euphoria turned out to be a nasty endurance probe. It feels like you make hardly any progress and it freaks you out when almost perfectly written code simply fails. Like ordering a full three course menu at the restaurant and not getting anything just because you pronounced the name of the wine slightly wrong (come to think of it, a short visit to France might be a good way to toughen yourself before starting #CodeYear).
The Second Coming
It took me until July to get back on track. I would not have waited that long had a known how things went from there. It wasn’t hard to get back in at all, even more to my surprise, things got better very quickly. Looking back, I still recommend a few weeks’ break. It lets sink in the basic principles of variables, parameters, functions and – yes – brackets and semicolons. Plus: It lets you restore your frustration tolerance.
When I took up coding again, I realised that I not only remembered a lot of what I had learnt at the beginning of the year, but actually saw things a lot clearer. As if something had clicked. That made progress in the following weeks fast and easy.
It was little more that an ironic statement when I opened a Github-Account in July (it’s basically a social network and collaboration platform for programmers). Even today, it says «Journalist. Programming Toddler.» in my bio at Github.
What I expected to get out of Github: to get a feeling of the community that makes (and occasionally breaks) our whole digital world, the people who zealously work on tools we journalists can use (see my collection on Quora).
However, I had no idea that I would be able to massively benefit from Github and its community a few months later.
My First Project
On October 7, the instructions for the weekly challenge at Codecademy simply said: «Use what you have learned so far to build something useful or fun». Up to this point, there was close guidance, you were told what steps to take to get to the final product. Not now: just an empty editor.
There it was again: the challenge to find your own goals. This time, however, no problem. I had gained a pretty good understanding of what programming is and what’s possible (for me). So my first tool came into existence, a simple word counter (try entering just a few words and see what happens).
The first project is a reward. And a caesura. It takes more discipline afterwards to stick to the course track. It ignites the motivation to tackle more, bigger projects – bearing the danger of overreaching ourself. I did both: I dutifully continued with the courses and came up with projects that were not in my league.
A Mentor IRL
I remember a number of moments during the year when I was very glad to have someone to explain things to me face-to-face, whom I could ask stupid questions. I was fortunate that Hannes Gassert got interested in my efforts early on and willingly helped me whenever necessary. It was he who set up the local server on my Mac, who explained to me how Commits and Pull Requests work on Github, who gave feedback on the code for my wordcounter.
More Projects and the Crucial New Dimension
I mentioned overreaching. The project with which I (deliberately) did so, was Famous First Tweets. A simple form to find any user’s first tweet. Tools like this, of course, exist already. I did it to practice working with forms and getting to know APIs.
Looking back, this was the project that made me realise that me and coding are really getting somewhere. A lot of what’s needed for successful coding came together:
- I was able to break down the project into single steps and identify the functions I needed for them.
- I was able to sketch the functions
- I was able to upload the project to a Github repository to enable collaboration
- I knew the right keywords to search for code elements on the web
- I understood the code elements well enough to embed them to my project
It’s thanks to these factors that the tool «Famous First Tweets» now really works (and thanks to a British programmer, Matt West, whom I didn’t know before, who contributed code elements via Github that were yet too complicated for me).
I’ve coded a number of projects since then, most importantly Instacurate, the final project of my CodeYear, so to speak. All projects are linked to on labs.davidbauer.ch. All of those projects relied on the factors mentioned above.
What I Would Do Differently
Looking back, everything has worked out fine for me. I’m actually astonished how far I got. So little regrets, but three things I would have done differently had I known what I know now.
- No five-months-break and tackle self-imposed projects earlier.
- Worry less about the fact that most exercises have no obvious relation to journalism.
So Then, Should Journalists Be Able To Code?
The answer is no. However, not a No meaning that coding is not something journalists should do. Just like not all journalists need to be great at writing longreads, just like not all need to have a voice apt for radio, just like not all journalists need to be good photographers, not every journalist needs to know how to code.
Journalism is a broad field and journalists distinguish themselves in their very own set of skills. Coding skills will play an increasingly important part in this mix. And, at least for now, if you know how to code, you have a skill that distinguishes you from almost all other journalists.
My own perspective on the matter has changed a bit due to the fact that my role has changed from being mainly journalist to mainly working on concepts and strategies to make journalism shine in the digital context. One thing has become evident: (Plat)form and content can no longer be considered separately, good stories do not just fit into an existing system, but explore the possibilites of technology.
You’re at an advantage if you know how to code. It’s really not about journalists spending their time coding. When things get serious, you’ll need an experienced programmer anyway. But when you understand their language, you unlock a whole new dimension of creativity. You have an idea of what’s theoretically possible and the vocabulary to speak to programmers about it. And yes, of course, you’re able to code smalls tools all by yourself. Not all newsrooms have their own programmers and not all programmers are always available to you.
How far I got
This is what I built at the end of my Codeyear: Instacurate – turn your Twitter timeline into a personalised news site, in an instant.
The Tools I Use
- Codecademy: to learn
- Github: to watch and to get help with my projects
- Coda2: to write and edit code
- Twitter Bootstrap: to quickly create basic page layouts
- Mozilla Developer Network: to look up the things I tend to forget
- Twitter: to share project ideas and get input and feedback
- Google: to search for code elements (you’ll be pointed to Stackoverflow in most cases)
- Do journalists need to learn to be programmers? Yes. And no. (Martin Belam)
- «Journalisten sollten programmieren können» (FAZ)
- The Journalist’s Learn To Code Resource Guide (Lisa Williams)
- Learnable Programming (Bret Victor)
- Welcome to Hacker Journalism 101, take your seats (Bryan Boyer)
- Please Don’t Learn to Code (Jeff Atwood)
- more to be added