Why code? And why TypeScript?
Over the years, I’ve been invited to give talks, often to students in various fields, academics, researchers, professionals of all kinds, and at conferences. I’ve also had countless video calls with people who saw my work and were interested in computational journalism, data analysis, and data visualization.
The same questions came up year after year:
- Do I really need to learn how to code?
- And if so, which language should I learn?
So here are my thoughts and why I decided to create this course!
Why code?
Point-and-click tools like Google Sheets and Datawrapper can do a lot. They are fantastic for quickly analyzing and visualizing datasets.
But they have their limits.
For example, you can’t process large datasets with these tools. Also, there will inevitably be moments when you think, “Ah! I wish I could do THAT!”, but you can’t because the tool’s capabilities constrain you.
With code, it’s different. In a way, it gives you a superpower.
- If you have massive files with millions of data points, you can harness your computer’s raw power to process them.
- If a feature doesn’t exist, you can build it.
- If you need to perform repetitive tasks, you can automate them.
And all of this can happen on your computer or a server in the cloud. Isn’t that amazing?
Code is also easier to debug and reuse.
For instance, imagine you’ve created a spreadsheet and filled it with data. To produce your analysis, you go through 10 steps involving clicks, menu selections, and cell typing. What happens if you made a mistake at step 3? You’ll have to scrap everything and start over most of the time. It’s slow, frustrating, and hard to remember exactly how you got there.
With code, it’s different. If you have 10 lines of code and the third line is wrong, you just fix that line. The rest stays as it is. Everything is written down, so you can always revisit it later.
Code is just text. It’s easy to share. If I need to double-check your numbers, I can read your code line by line, run it myself to reproduce your results or tweak it to explore other possibilities. If you want to be transparent with your readers, you can also easily publish it, increasing their trust in your work.
On top of all that, there are also a lot of amazing coding courses, like this one. 😉
Which Language?
There are many free and open-source programming languages, but the most popular ones for data analysis are Python and R. Both are fantastic, supported by vibrant communities, and packed with amazing tools. I’ve personally enjoyed using them for years.
However, they’re not ideal for publishing on the web because the web runs in another language: JavaScript. And in journalism, as in many other fields, publishing on the web has become essential.
At the same time, JavaScript was not a very good choice for data processing in the past, but it had (and still has) exceptional libraries for creating highly customized, high-quality visualizations.
This led to a two-step workflow for most digital data projects:
- Gather, clean, and analyze data with Python or R.
- Visualize and communicate results using JavaScript.
But over the years, JavaScript has evolved. The language significantly upgraded with TypeScript, making writing and managing complex code and data easier. JavaScript/TypeScript runtimes became more accessible and powerful, and new tools emerged to process massive datasets at remarkable speeds.
At my level, I’ve tried to contribute to the field by creating simple-data-analysis, a library to easily and efficiently process data. I started working on it in April 2022 and have used it for all my projects since.
So, if I were to recommend a language today, it would be TypeScript. With it, you can answer important questions by leveraging millions upon millions of data points, while effectively communicating your results to the world, on the web, just like computational journalists do.
And this is what I want to teach you: how to code data-driven projects with interactive data visualizations using TypeScript, from start to finish.
I am sure we’ll have a lot of fun along the way. So, let’s code like journalists! 😁