Why Should Medical Students and Doctors Learn to Code?

Coding doesn't appear to have a lot in common with medicine. But the pandemic is showing us how valuable this knowledge is. This issue attempts to look at why coding is so beneficial for medical students and doctors.

Why Should Medical Students and Doctors Learn to Code?

This week I decided to write about coding and how it can be useful for medical students and doctors. The inspiration for this came from Josh Case, so make sure you visit his website for more resources. In this issue, we’re taking a step back and looking what’s in for you behind digital health.

My first meeting with coding was sometime in primary school when my parents were trying to get me to start learning to code. I did, only I wasn’t that interested in it and quickly forgot all about it. Then a few years passed, and I wanted to start a blog but was annoyed with the constraints of website builders. So, in my first year of medical school, I decided to learn HTML and CSS.

It turns out this is one of the most valuable skills I’ll ever learn. Not just because it allows me to build static websites online, but because it got me thinking about learning more programming languages and solving problems (my own and other people’s). I’ll support these two arguments with 4 points.

Become a specialised generalist

The old-school approach to success is to double-down on one skill and learn it until you become the best at it. Invest 10,000 hours of work (or iterations) and you’ll become the best at your craft. But more recently, this mindset has changed.

In the books such as Range and articles such as this one, it’s becoming ever more clear that having more skills, even if you’re not the best at them, is better than being excellent at just one. This gives you more chances of success. Firstly, because there’s less chance that someone else also picked exactly these two (or more) skills. Secondly, because one skill affects how you think about the other and makes you approach it from a different perspective.

Coding is more connected to medicine than you might imagine. It’s very similar to diagnosing disease in medicine. You identify a problem, look into what might go wrong and try to fix it. This is a passage from Josh Case’s article “10 Reasons Doctors Should Learn to Code”:

To appreciate this point, you first have to understand that the vast majority of time spent programming is not writing brand-new code, but rather diagnosing problems with new code interacting with old code. One of the essential core skills of a programmer is in fact diagnosis - just like doctors.

Another point to make here is that coding can give you an escape from medicine. Just like music or exercise do. In my opinion, you need other things in your life to function the way you want to. And sometimes, you just have to take a break from all of it. In my experience, I feel and think a lot better when I do other things alongside medical school. There was a small period when I didn’t, and I regret it.


Having a basic knowledge of coding with JSON and APIs gives you a powerful head-start in research. For example, I was participating in research where lots of data had to be organised into an Excel spreadsheet and the only way I knew how to do it was manually. The data was all over the place and had I knew how to access it, pick the participants to include and organise all of it in an Excel spreadsheet would make my life a lot easier.

If you invest time in learning basic code, you can save more time in the future. This is what Josh has to say in the article I mentioned above:

You can't get far into programming without having to understand how to handle or process data on a basic level. APIs, data structures and JSON files are all different constructs you will encounter at one point in time or another, and these all have big implications for research.


Digital medicine is developing faster than ever. Startups are emerging quicker than ever. They’re the perfect mix of digital technology and medicine, and they are hungry for doctors who can code. There’s a lot of value in connecting the two fields and making something new out of them.

There’s a ton of them out there, and I mentioned just a few over the last 40 issues. For example, OtoHealth is developing an app to treat tinnitus. Whoop is a new kid on the block of wearables. Lue is developing a kit for in-home monthly urine testing. I won’t lose words about Nerualink. And if you dig deep into blockchain, you’ll also find healthcare applications there. Don’t worry, there’s more out there and ever more coming.


In my experience, I can break down the opportunities that coding gives you in 3 categories.

First, you begin to understand what’s possible and what you can do to make your (and others’) life better. Even if you learn just the basic HTML and CSS you’ll begin to see what you can solve by making a website instead of, for example, a Facebook page. This basic knowledge and some design skills give you a huge advantage. For example, you can make a website for every project or event you organise and start collecting emails (which you can’t on Facebook). Later on, I’m sure the same happens with more advanced knowledge.

Second, by knowing some coding, you start seeing business opportunities. And not only in medicine. The best feature of the internet is that you have infinite leverage. For example, I know that when I write this issue, I can send it to 10, 100 or 1000 subscribers and the amount of work is still the same. The same is with coding. You make it once, you can “sell” it twice.

Third, it’s almost inevitable that you’ll start putting yourself out there once you begin experimenting. Solving your problems is awesome at start, but the real opportunity lies in solving other people’s problems. The other day, I came across a very truthful quote from Yusef Smith of PropaneFitness (not related to coding, though):

We don’t hear about experts, because people who shout the loudest get the most exposure. And so, there’s this trend towards putting so much effort and energy into social media and marketing that the people who, are just quietly in the trenches doing stuff get ignored. - Yusef Smith

This tells us that putting ourselves out there as medical students and doctors is so important. During the pandemic, influencers appeared the loudest and smartest because they had so much more exposure online. Wouldn’t it be great if it were the other way round?


If you resonated with this issue, want to start learning to code, but have no idea how to do so, I can assure you it’s very simple. Start with HTML and CSS and make a simple website for yourself. I recommend this course from Scrimba (free). Honestly, it shouldn't take you more than a week.