MECHANICAL ENGINEERS SHOULD LEARN PYTHON

originally posted on Quora in response to the question “Which programming language is most suitable for a mechanical engineer?”

So the other answers here, while good, gloss over some nuance.

As Shreeyash Lalit alludes to, mechanical engineers deal with 4 main classes of computation. Computer Aided Design , Finite Element Analysis, Data Acquisition, and Numerical Analysis. It’s good to be competent with the usual tool in your industry for each of these, but know that their domain is deep and that people have spent whole careers becoming experts in just one.

But let’s look at each a little closer

CAD/FEA

That said, your question asks about programming languages, and neither CAD nor FEA is a programming language. Though most have API’s of some sort—accessible via either visual basic, python, or maybe a home-grown scripting language—you won’t be “programming” at least in the traditional sense.

Data Acquisition

For data acquisition, LabVIEW is the only choice. Strictly speaking it is a programming language, but it’s use is comparatively niche and it’s graphical scheme is unlike all other programming languages that are built with lines of text. I see the value of LabVIEW as inversely proportional to the size and complexity of a program, as well as my desire to reuse code.

Numerical Analysis

I guess this is what your question was about all along and it comes down to two options: MATLAB and Python. Don’t bother learning FORTRAN until you need to (again, unless your industry demands otherwise… most don’t).

So… MATLAB v Python. If you want to be able to put something on your resume that will help you in getting a staff engineering role in a big firm, put MATLAB. Raytheon, for example, is not (currently) going to have institutionalized python, but they have with MATLAB. MATLAB also has great customer service, a bunch of free seminars, and their “toolboxes” of extra functionality (which you pretty much need to do anything cool) pretty comprehensive—and expensive.

All that said, I would still go with Python Why?

So I pick Python, and you should too.