top of page

So you want to code (computer program)

Recently I was at an event that included many medical doctors who wanted to learn to program a computer. Learning to program is invaluable, even if you will never write a program to be used by anyone but yourself, because as computers become ubiquitous, it behooves you professionally to understand what is going on inside them at least in terms of applications built in your field. I'm happy my colleagues in radiology in Europe are able to learn from specific material I developed related to radiology...but now I've decided to step back, and throw out some hints for anyone. ANYONE who wants to learn to program a computer, and has no idea where to start.

1. Get a project you want or need to get done.

No amount of reading or courses or code notebooks can substitute for actually having to complete a project you code for. I learned to code this way. Sure I had formal instruction as a C programmer, but what made me a real programmer, and not just another corporate drone trying to shirk my programming assignments was coding for myself. I made a website to showcase my artwork. I wanted pictures to come in and out of the screen. Everyone has to start somewhere and two decades ago I started by building my artwork website, and then another website, and then another, and another....and before you knew it I could make animations fly across a screen- platform independently. Maybe you want to make a website, do the statistical analysis of your research or just organize your online music collection...but get a project, or you won't really learn much. Of course, books, courses and so on help too, but use them as you try to complete your project.

2. Do not read message boards or Medium too seriously.

Back when I started programming it was a very geeky thing to do, and the a few people doing it tended not to publish online tomes and rants about their work. How times have changed. Now anyone who can write a single function runs to publish about it online...sometimes I think the less expert these people are, the more likely they are to write an article about it. The result is endless not quite correct fluffy nonsense about programming written with an imprecise vocabulary online everywhere. Unfortunately, computer programming is not like women's fashion in all senses...Following the instructions of someone basically regurgitating drivel who just got something to work, and has now crowned themselves some sort of programming guru will have uneven consequences.

3. If you can, find someone who knows what they are doing, programs in several languages, and work with them.

These people can read your (and my) code like nursery rhymes. Invariably, these people tend to NOT be front-end developers/ web programmers. The people I'm talking about tend to have been programming about as long as I have, or even longer. When you have been in the game long enough, you have insights young people do not. One annoying insight I have is that Python is popular, so whatever the problems, we will be stuck with this language for a long time now- not because it's awesome, not because it's efficient- just because everyone ELSE is programming in it. If you can't find a real veteran, at least find someone who can start you out with the basics like how to use a console (or terminal emulator) and shell. If they have never heard of those things and claim to be good at programming, you are dealing with someone with a mistakenly high opinion of themselves (the Dunning Kruger effect is a huge issue it the programming world).

4. Get an environment and language for newer programmers.

I learned to code the hard painful way in C two decades ago. I do not suggest starting in even C. Now when I code in Python in Visual Studio Code it's like painting by the numbers. Even bad people do good things occasionally- and yes, Microsoft made Visual Studio Code. May you use it on a Linux machine (i.e. not Microsoft Windows), if you ever get serious. Whether you choose R or Python, VSCode or something else...just don't choose Rust which you program with Emacs. You need to crawl before you can walk.

5. Have fun, and don't take it too seriously.

Even if your program crashes, you probably don't know enough to damage your computer's memory. If you learn for yourself- you can't really fail. You can only get better and better.


bottom of page