r/AskEngineers • • Mar 16 '19

Mechanical Is it worth learning Python as a Mechanical Engineer?

Greetings, I am a freshman in Mechanical engineering and I've already finished my MATLAB course, and I find coding fun, so I was wondering if I should learn python? But of course I won't waste my time learning it if it isn't beneficial to me. So my fellow MEs, how useful would it be learning python? And what are these benefits. Thank you!

296 Upvotes

165 comments sorted by

View all comments

Show parent comment

9

u/AlexanderHBlum Mar 16 '19

Matlab has try, catch and the inputParser object. Between these things sanitizing inputs and handling errors has always get reasonable to me.

I’ve never had any trouble finding the location of an error in matlab code, but maybe I’m misunderstanding something about what you’re saying.

I’ve also never tried to write unit tests, by a quick google found a page showing the (seemingly) extensive functionality matlab has to assist in running several types of unit tests.

7

u/rlbond86 Electrical - Signal Processing Mar 16 '19 edited Mar 16 '19

Matlab has try, catch

But they are nearly useless because all exceptions are of type MException, so you have to start parsing the exception object's properties to figure out what happened. To say it's half-assed is a massive understatement.

4

u/AlexanderHBlum Mar 16 '19

Thank you for explaining where the shortcoming is. I appreciate it.