4 ms·
I wonder if Matlab being most hated relates to people being forced to learn it in undergrad and it being poorly taught etc. I’ve found it very useful but it too
by xt00 4y ago
I wonder if Matlab being most hated relates to people being forced to learn it in undergrad and it being poorly taught etc. I’ve found it very useful but it took a fair amount of time to build up the set of tricks to doing things right. I would imagine a good replacement for it now is python but there is a huge reliance upon things like numpy and the various plotting libs — not sure what is being taught these days for the courses that previously used matlab — are they now using python a ton?
- 323 4y agoI vaguely remember that in Matlab some form of chaining wouldn't work: a.b.c. You had to do x=a.b and then x.c. It had all kinds of quirks like that.
- TylerE 4y agoYou couldn’t do something like (a.b).c? Still hackt, but a one liner at least Disclaimer: have never touched matlab
- 323 4y agoSo I googled that: setdiff(1:3, randi(3))(randi(2)) > One must factor out the resulting list from setdiff into a separate variable first: t = setdiff(1:3, randi(3)); t(randi(2)) > This is so medieval even by 1980s standards... https://www.mathworks.com/matlabcentral/answers/1684819-why-does-not-matlab-language-support-function-operator-chaining https://www.mathworks.com/matlabcentral/answers/1684819-why-...
- TechBro8615 4y agoI think you're probably right that most developers only really had exposure to Matlab in undergrad statistics and engineering courses - sometimes simultaneously with Stata *shudder*... But that doesn't mean they're wrong to hate it. It's a proprietary program with origins in the 1970s (that's 50+ years old!) and comes with a lot of cruft. I don't know what university courses are using these days, but a lot of universities have data science majors now, so presumably there is some exposure to Python there. A lot of statistics courses also use R.
- ginko 4y agoMy professional experience with Matlab was having another team of mathematicians develop an inverse kinematics library in Matlab and us having to integrate that in a C++ Qt app on Windows. Let's say that experience wasn't great..
- grahamas 4y ago> I’ve found it very useful but it took a fair amount of time to build up the set of tricks to doing things right. What kind of tricks are you thinking of? > I wonder if Matlab being most hated relates to people being forced to learn it in undergrad and it being poorly taught etc. To me, as someone who has used Matlab fairly extensively both being taught in undergrad and in programming-centric grad research, Matlab's one and only strength is in its being a one-and-done IDE/programming language. If you're using Matlab, then you're using it in an IDE that "just works" and was installed and configured simultaneously with Matlab itself: there's no real distinction between the two. Further (assuming you check the right boxes during installation [1]), all the possible packages you could ever have [2] are installed at the same time. So you get a super simple install and never have to think about installing or configuring anything ever again. I don't want to minimize how useful this is. Every other programming language I've ever used has had a huge amount of installation and configuration overhead, often an insurmountable barrier for non-programmers (e.g. scientists). That said, I dread using Matlab, for many, many reasons. My top three reasons in no particular order: 1. you can only really define one function per same-named file, 2. errors are almost always one line long (no stack trace) and rarely give a line number in normal usage, 3. cell arrays. Cell arrays are basically just untyped lists, yet somehow mind-bendingly confusing to use. [1] assuming you paid for the right to check those boxes. If anyone is wondering, to get all the boxes in a non-personal context would cost 100x more than whatever you're thinking (which is a bit of a straw man since no single person needs all the packages and institutions get crazy bundle deals). I haven't taken the time to add it all up, but base MATLAB is $900/year/computer, and each of the ~100 packages costs $500-2000/year/computer (skewing heavily to $500). So, roughly $50k/year/computer for everything. Which is silly, obviously. Most people only want a handful of packages so realistically it's only about $2-4k/year/computer. Only. However! If you just want it for non-commercial, non-academic, non-governmental use, you can buy Matlab for only $149 + $45p, where p is the number of packages you want. [2] Literally, all the packages you can have. Package development is 98% limited to Mathworks-official packages.
- xt00 4y agoYea I would say the main set of tricks related to using cells, working with large text files, and working with things like meshgrid as a few examples. Super easy to get confused even with good documentation and examples. Matlab benefits from the various people who work at mathworks who fix things and communicate with customers when you find odd issues.