Why you should learn to code
There is one reason why you should NOT. It will be very hard. You will have to learn not just one tool but many different as your skills and the level of your projects continue to grow. You will have to skim through endless lines of documentation to find the one detail you did wrong – or worse – through endless lines of code written by someone else, poorly commented, and written in a different style than yours. At times, you will hate your poor little computer or laptop with burning passion, engaging in fantasies of hitting your fist through its shattering display or slamming it on the ground and watching those tiny keys scatter about the room. With no reason except that it did exactly what you told it to do, just not what you wanted it to do.
So…why learn coding?
Automate the Boring Things
Do you ever get repetitive and boring tasks?
Of course you do. Even if you are really lucky and landed an amazing and diverse job somewhere, those tiresome duties are bound to occupy a large part of your schedule. As a scientist, I believe I am privileged to follow a profession that offers a lot of variety and still, I regularly find myself forced to copy large swabs of data from one place where it was originally generated in some obscure format onto my machine, into a common file type, then copy select parts of that into a spreadsheet, do some calculations on it, move the results to yet a different place and then finally visualize it, adjusting the graphics program settings until I have something in hand that I can show to other people. Worst case, someone finds a mistake and I have to go back to step 1.
At least that is what I would have done before I learned how to code. Now all happens with a single command. And if some error surfaces, I adjust it in my code and run the corrected version over the hundreds of previous datasets, go grab a cup of coffee, and return to find my work done.
This is the single biggest advantage of learning how to code. Dispensing with those dull tasks that you resent and focussing on the things that you actually want to devote your energy to. With a small set of useful tools (for things you regularly spend lots of time on – this XKCD illustration helps avoid the most common pitfall with this), you can get done way more in less time.
Coding gives you exactly what you want
Not only can you automate routine, boring tasks, but you can also get the exact thing you want! Custom messages in your output? All your publication-quality graphs in a color scheme accessible to deuteranopes? A csv-file arranged in exactly the way this one fickle decades-old instrument in your lab can take as an input? No problem when you aren’t force to rely on software manufacturers’ standard tools anymore.
I recall one counter-example where a finicky custom solution was formed by forcefully conjoining a set of standard tools to fit spectroscopic data. It went something like: copy data from CSV to Origin (the scientist’s Excel, for those not familiar) via clipboard — add some constants — perform the fit — copy everything to Excel to do some more calculations that are hard to find in Origin — copy back to Origin for visualization. A problem like that would have been a perfect chance to invest time in writing code once and then profit permanently from getting the exact result they wanted with one click. Unfortunately, nobody knew how to do that.
Coding pushes your career
Which brings me to the last point: imagine, in the place you work, things were always done the way outlined above. Now you come in and write a tool that does this annoying and time-consuming work in a few seconds. If your boss has any grasp of what his employees are spending their time on, it will certainly leave him impressed. You just moved from someone who might put in some effort (albeit the rather mindless variety) to someone who actually solves problems. That’s a critical difference right there!
Coding is a new form of literacy
As you face job search, particularly in industry, proven programming experience will come in very handy. Many a scientist may find that when they leave university, the demands of employers are much more versatile than their qualifications. Programming experience is in high demand and will be even more so in the future. Don’t get me wrong, you will likely not become a data scientist or a web developer if you have not already taken the path towards those in your education. But the ability to code opens up opportunities for horizontal career moves as well as giving you a strong competitive edge over people with a narrow set of skills. To borrow from an opinion piece published by the Royal Society of Chemistry: Coding is a new form of literacy.
And…the very best thing about coding
Coding is often hard, frustrating, and (by its very nature) unforgiving. You will have to bring quite some endurance to the table to learn it. Your code will have to be changed over and over to do what it is supposed to. But then, after many, many, MANY revisions, your code just runs, does exactly what you need done, whenever you will need it done in the future. That’s the best part.