Why all scientists and students should learn how to program

Programming is one of those skills that seem to be shrouded in mystery for the uninitiated, and for the initiated simply as second nature. I have been programming for 19 years (yes I started when I was 12, yes I am 31) and I can say that it helped me a lot during my (academic) career! I also notice that many students and fellow scientist don’t seem to see the benefit of learning how to program, or simply don’t want to go through the hassle. I understand that when the benefits are unclear that you would devote your time to other things. However, I hope that after reading this post you have a bit more reason to start programming!

I would also like to say that it is not that hard to learn to program. A programming language is made by other humans to make it as easy as possible to make great things! So it is not designed to be complicated!

For now lets focus on the reasons why I think it is useful to learn how to program:

Structure your thoughts

This is perhaps a weird thing to add to this list, but I consider it one of the most important benefits of programming: you learn to split up large problems into smaller manageable ones.

In a nutshell a program is just a list of commands that your computer executes. This means that you are forced to make this list of commands that together solve a large problem. I call it a problem, but programs can be made for various of reasons, so problem is a merely a placeholder for “getting to your goals”. In making this list you are forced to think of what you want to accomplish and you are forced to break down your problem into smaller problems.

If you go further into programming and your programs become bigger and bigger, spanning various files and thousands of lines of codes, you often make a design before you start typing. I compare this a bit to outline in the process of writing, where you try to structure your thoughts before you start typing your book, paper, or blog post.

I realize more and more that I am getting better in splitting up problems outside programming as well. I cannot ascribe this all to programming, but a some part definitely. It helps me to split up a problem, but also in taking a step back and see how it all fits in the bigger picture. Sometimes when I am writing code I realize that the part I am working on does not fit in the program the way I intended. I can then make the decision if I rewrite the code, or if I continue on this path. At least it is a conscious decision.

Make the software that you need

Now turning back to the benefits of the results of your programming effort, and not so much on the process itself. I am often find myself in the position that the software that I have on my computer cannot do something I want it to do, or that it is complicated to work with the software. Or when the program I have does not read the file I have, but the information is just there. During my master thesis I was constantly switching between different file types until I could take it no more and I wrote a program to do all the converting by simply running the program once.

Buying computer programs is a very expensive business. I understand that programs cost a lot of money, however it does not have to be that way. There is a huge community that creates open source software. This is software that is free, but maybe more important the source code can be read. This means that if the program lacks a feature you need, you can just add the feature. (Don’t forget to give back your added code to the community). If you can program, you can do this! Super useful.

Removes repetitive tasks

Programming helps me to remove repetitive and simple jobs from my daily work. I don’t want to write a hundred input files for a program where only one number is changed. I want to make figures automatically for my papers. I want to gather data from different data-sets automatically and output it to a format that works for me, for how I view my data.

So where do you start?

After these reasons you might want to start to code, and that is great! But how do you start? I suggest you look into the very popular programming language Python. I am writing a course on how you can start using Python, but it is not finished. However you can get started for free on EDX, which is a great online source for all kinds of course. Just look into a beginner course in Python, like for instance this one.

Avatar
Wouter G. van Veen
Promovendus

I use computational fluid mechanics to research the fundaments of insect flight.