3 ms·
Matlab is much lower friction than python. You write a function, using nice linear algebra syntax. Already python is worse: you do a bit of import boilerplate
by patrec 6y ago
Matlab is much lower friction than python.
You write a function, using nice linear algebra syntax. Already python is worse: you do a bit of import boilerplate and write linear algebra in a gimped notation. You call the function. Not so in python, where you have to import it first. You change the function definition, next call will be redefined function. In python you can try to do an interactive reload via third party software but chances are it won't work right since Guido apparently never considered this something worth designing properly (apart from matlab lots of "real" programming languages are much better at this, including erlang, common lisp and smalltalk).
Your function runs too slow. You press a button and you see a color coded version of the code in your editor window and see instantly where the bottleneck is. In python you break out one of several crappy profilers. You want to save your results from your interactive exploration "save results.mat" -- done. In python there are various ways of saving stuff, which are either not general or slow or don't work between different versions.
I haven't used matlab in years, but as an interactive environment for linear algebra it blew python out of the water and likely still does, even if it has a number of big shortcomings as a general purpose programming language (and probably a worse selection of libraries in quite a few numerical domains these days as well). This is particularly true if the people using it are not trained programmers.
- dragonwriter 6y ago> You call the function. Not so in python, where you have to import it first. Er, no you don't, if you are using it in the same notebook, module, or REPL session where you defined it. And if you aren't doing the equivalent in MATLAB, you also would have to load the definition.
- patrec 6y agoWhat on earth are you talking about? If I add `def bar...` to a file foo.py in my PYTHONPATH, it does not suddenly become available in my interactive session, I need to import it first. Further if I change foo.py even importing it again in the repl (or jupyter notebook) will not have any effect. You will need to use one of several reload hacks which in practice won't work reliably for all sorts of reasons. In contrast, unless my memory severely fails me (and I don't think so, since I just checked against octave), in matlab if you edit a file in the path, it will be auto-imported every time you save it as soon as the repl is non-busy. Have you actually used both matlab and python?