Hacker News new | ask | show | jobs
by acdha 2942 days ago
It's interesting because those were the reasons I heard from MATLAB users for switching to Python: moving to a language with a cleaner, less ad-hoc design and less boilerplate / copy-paste code made a big difference once you had more than a little code.

Has the language improved dramatically in the last few decade?

2 comments

Python is much better than MATLAB in non-mathematical domains. Hell, MATLAB didn't even have arrays of strings until 2017! But in the mathematical area, SciPy is really lacking syntax-wise. Here's a quick side-by-side comparison which is also useful for teaching between the languages:

https://cheatsheets.quantecon.org/

You can go as far as to say that Python is verbose in many cases, and non-intuitive in others (A @ B?).

That said, you would never want to write a webapp in MATLAB, so as people expand from "math scripting" to "programming" they run into MATLAB issues which have absolutely no good solution. This is where the Python pickup comes from: it's still decent for scientific computing, but it also is an actual programming language. However, Julia keeps the nice syntax of MATLAB in the mathematical domain, keeps the technical computing focus of its community, adds some speed, and also is a general-purpose languages where webservers etc. are being written. In that sense, Julia is a really good fit for people looking to ditch MATLAB.

(A lot of MATLAB's bad syntax was bolted on later. It started as MATrix LAB, and later became a programming language. You can easily see the elegance of its initial design, and the terrible choices when extending it.)

Oh no, it's the 90's: we need classes, right now!
Matlab is good for non-software engineers and scientists to explore and solve problems. Once you have a solution there, write it up in some proper language.

I don't think it is likely for a software engineer to understand Matlab's niche and effectiveness. It comes from a different direction.

A ball point pen, a paint brush and a piece of drafting graphite all have their uses.

I'm an electrical engineer oriented towards signal processing and controls, and I'm also incapable of understanding Matlab's niche and effectiveness. I wish Matlab could just vanish. It's a glorified calculator that has mutated over the years into a crap programming language, with random features just bolted on and the strangest semantics of all time.

It also has the drawback that most of its users generate write-only code, so everyone that learns it also learns to write code that way.

I second this. And to make matters worse, a lot of MATLAB users are not aware of coding style. Poorly readable MATLAB code stinks. I sometimes rather wish to read Fortran 90 instead of MATLAB code.