Hacker News new | ask | show | jobs
by actinium226 1251 days ago
I recently talked to a math postdoc about Python. He said

> "Yea some of the new PhDs try it out until they find out how awful it is!"

I clutched my pearls, aghast, and asked him why he thought Python was awful? He said that the community supported tools have problems, but the toolboxes provided by MATLAB are high quality and just work. I told him that I thought he was misguided, that Python tools work quite well and that the Python community is a strength not a weakness, that when a tool doesn't work well it's an opportunity to contribute.

He listened politely, but wasn't convinced.

6 comments

I use Mathematica, and it's great strength is the curated data available for doing exploratory work. You can link to data with Python, but you need to set it up, but in Mathematica it's there from the installation. There are more things you can pay for and add, but the base installation is cohesive and powerful. Mathematica's notebook preceded Jupyter and is still better. I use the Home edition that I pay for. If I get work that uses Mathematica, I will buy the full version. I tried to use Octave as a substitute for Matlab but wound up moving to Julia. The code is very similar and easy to jump between the two sans the Matlab add-ons, however, Julia is developing a Symlink alternative.

My aversion to Python is a personal bias. It is an easy language to pick up and has won its place. I just don't like it. I was using Lush back in the day (Yann LeCun was one of the creators), and I wish it had won over Python due to my Lisp predilection [1]. It is a Lisp-like syntax that compiles to C.

[1] https://lush.sourceforge.net/

What's the Julia Simulink alternative called? In Googling it I found sims.jl which isn't quite a simulink alternative so I wonder if you're talking about something else?
ModelingToolkit.jl, a comparison is given here: https://docs.sciml.ai/ModelingToolkit/dev/comparison/#Compar... . A showcase from one of the library's users, demonstrating a 15,000x acceleration, was given at a SIAM conference and the recording can be found here: https://www.youtube.com/watch?v=tQpqsmwlfY0
<<was given at a SIAM conference and the recording can be found here: https://www.youtube.com/watch?v=tQpqsmwlfY0>>

At 14:00, the interactive slider exploration due to the speed is amazing. Over 500 Monte Carlo simulations in less than 60ms.

>He listened politely, but wasn't convinced.

He listened, but he probably doesn't care.

He uses whatever software helps him gets his job done and that's it. Software developers and enthusiats in general usually care about free software, other people not so much.

And also we can't pretend that free sotware projects like octave are not playing catch up with its commercial counterparts, it's not like hundreds of paid developers and billions of dollars getting thrown at the development of new features don't make any difference.

The statement about matlab toolboxes is so wrong it's almost funny. The quality of different toolboxes varies dramatically. Some are quite high quality but others are a buggy mess and all of them are expensive. That said, the statement is very field dependent. Fir example I know that many (most) communication theorists are using matlab, because the communications and signals toolbox does so much that would be otherwise tedious to implement. On the other hand many experimentalists in the same field have moved on to python because the instrument toolbox is so buggy and coding GUIs in matlab is an exercise in self mutilation.
To further reinforce the above argument, many environments dominated by Matlab have their instrument control software written in Python. Mathworks have made it pretty easy to call out to Python (although no Conda/Venv support...), they definitely feel the pressure in that area.

(Double checked your username, seems we've discussed the Matlab/Python space before!)

> when a tool doesn't work well it's an opportunity to contribute

That's like trying to convince someone to buy a fairphone and telling them that if the phone is lacking in some area, they can contribute to the design. Maybe you believe in the message and you're willing to make sacrifice, But if you're a math postdoc whose immediate concern is getting a tenured job before time is up, you just use what's easy and works, because you've got other stuff on your plate that is much closer to your expertise (developing new mathematical knowledge).

You're right, and honestly I was just trying to think of something to try to shift the narrative. There are other advantages to Python, personally I really value its expressiveness, the plethora of good tools (Jupyter, PyCharm, Spyder), and the massive amount of libraries in different domains (beyond all the scientific stuff there's Panda3D, pygame, Django), but I don't think these things are selling points to those in the MATLAB world. Having used MATLAB to a medium degree, I know that if you're just trying to get something done you can do it, so a more expressive language is not really a selling point. The extra tools and libraries might be a better talking point, but yea I was just trying to find some angle that I could leverage to make the guy curious about Python.
I think you're both right, but you might be thinking of different tasks and libraries. If we're talking about solving a specific type of PDE, then in that scenario he's probably right that MATLAB will work better out of the box, but if we're talking about logistic regression on data from a messy CSV table, then python will work great and have better usability than MATLAB (IMO). He might also be thinking of versioning and packaging headaches in python, which are quite a pain the first time exposed to them coming from a walled garden environment.
Actually, yes, he did mention packaging headaches as well. MATLAB manages to sidestep the issue by not having a package manager, and basically forcing you to include the literal source code of any non-mathworks dependencies in your repo.

We do need a better story with dependencies in Python, and I'm happy to see there have been several posts over the last week talking about this issue.

That said I think that for academic projects it can be fairly straightforward to handle after an initial learning curve. A lot of projects can be accomplished with just numpy/scipy/matplotlib and maybe a couple other specialty libraries.

MATLAB does not sidestep that issue. It kicks it back to the user to worry about. Dependencies in MATLAB are essentially non existent. It's up to you as the user the manage everything about them.
Well he's right. Python can't scratch the surface of most MATLAB toolboxes (Octave is a lot closer). And Matlab's general user experience and plotting support is just a million miles better. Both languages are fairly bad so I don't think that would be a factor.
Have you tried the Spyder IDE for Python? For me its user experience and plotting support are very MATLAB like. It was the missing IDE that made it possible to get that MATLAB style workflow but do it with Python (or alternatively, to use Python for scientific tasks without having to always be going through CLI or notebooks, each of which have their issues).
I haven't actually! Maybe with a shot, although I've paid for Matlab now and I really hate Python...