Python is king

TLDR; Learning python brings you the most return on investment for your time.

Although python has it’s share of gripes, it is the most useful programming language to learn as an engineer. Before you start grabbing your pitchforks, I say for engineers not for programmers. This article is written to:

  1. Explain why I learnt python and situations where I find it useful.
  2. Convince engineers to add python to their list of tools to broaden their horizon considerably.

A much better case for python has been made by Cameron but here is my opinion for reference.

Simplicity

Python is simple from a developer and user perspective. Installing and running python takes less than 5 minutes in Linux and MacOS. OSs install python by default in a few cases. Setting it up in Windows takes more effort as is the case with everything else in Windows. There have been instances with the python executable not being added to the path when I installed python but starting with python is a smooth developer experience. There are excellent integrated development environments or text editors with plugins that make the developer experience enjoyable. I currently using VS Code with the appropriate plugins. I would like to switch to neovim in the future. But slowing down my developer output is not viable at the moment.

Packages

Here is a list of things I have used python for in no particular order:

I use numpy and scipy extensively to generate data for signal processing at work. I am evaluating TensorFlow and PyTorch as alternatives. I routinely perform measurements in the laboratory where pymeasure is invaluable. This is to demonstrate that I don’t have to write much code myself before I see direct benefit in my day to day activities. I am leveraging work of smart people, much smarter than me. This doesn’t mean that I don’t try to understand the underlying systems. As an engineer I try to understand all the tools I use as best as I can. A few abstractions can be examined a later point in time though. I try to avoid unknown packages and stick to large libraries to minimise chances of malicious code.

Community

Infographic: The Most Popular Programming Languages | Statista

Popularity of the language and general acceptance matters. Python has one of the largest community of developers. It is backed by several large companies and there is always a need for python developers. When I run into an issue or bug, I almost always find useful tips on stackoverflow, blog posts or tutorials. Sharing your code via scripts and packages is easy. I have run into issues with MATLAB where it takes colleagues hours to figure out how to install it along with the toolboxes needed to run my code. Allowing anyone in the world to use the tools I make is important to me.

Practical tips

References