3 ms·
> it's unlikely people (students) are forced to use it, thus less Dread. Which also likely explains MatLab being absolute last.
by waffleiron 4y ago
> it's unlikely people (students) are forced to use it, thus less Dread.
Which also likely explains MatLab being absolute last.
- jacobolus 4y agoTo be fair to the students, there are a lot of extremely frustrating things about Matlab, which is okay for short bits of 2-dimensional matrix arithmetic (“matrix laboratory” is an apt name for the language), but quickly sours if your needs extend even a tiny bit into anything requiring 3+ dimensions or data structures other than numerical arrays or data types other than real/complex double-precision floats, or if you need to debug anything, or even if you just want to put more than one function in a file. (Also it is a source-unavailable black box that costs an arm and a leg.) The general unpleasantness of Matlab explains much of Julia’s popularity. (On the flip side, Matlab was a great tool and a significant achievement when introduced in the 70s. Cleve Moler did a lot of great work that advanced the state of art in numerical analysis and applied mathematics. We can celebrate that history while still trying to avoid Matlab whenever possible in 2022.)
- cycomanic 4y agoFunny that you say that, one thing that always annoyed me about Julia (and I tried to like it, but ultimately never found a convincing argument to switch) is that they followed matlab conventions so much. 1. Making multiplication between arrays a matrix multiplication by default, not element wise. Not everyone is doing LA, the fact that you have to consider different operators /modifiers for multiplying scalars and elementwise vectors adds significant mental overhead if 99.99% of all your multiplication should be elementwise. 2. Why oh why the '.' as the broadcasting operator. Anything (except maybe the komma) would have been better. The '.' is just way too easy to overlook. When I was still helping students with their matlab code (I now use if you want my help as a incentive for them to learn python) the problem was in 90% of the cases a missing dot somewhere. The bad thing is that it breaks in weird ways, you just get nonsensical results without a crash. This is related to point 1, because most of what we do is elementwise so you have to put dots everywhere. 3. Indexing starting with 1. This one is actually very minor and really just a personal preference. I understand why Julia did this, i.e. to attract the matlab users, but it makes it so much less appealing for those of us who have moved on already due to matlabs shortcomings.
- adgjlsfhk1 4y agoThe argument for `*` being matrix multiplication is in many ways a lot more consistent (especially the way Julia does it where `exp(M)` is a matrix exponential. Julia treats matrices as objects in their own right with an algebra on them (specifically as elements of the general linear group). It does take some getting used to if you're coming from numpy, or another framework where arrays are just considered as data storage, but IMO, the result is more consistent and useful.
- patrick451 4y agoWhile the one function per file thing is certainly frustrating, I still find numpy to be way more annoying. I think it's api is very inconstent and it's treatment of 1d arrays leads to a huge number of bugs. I'm not sure what your complaint is about lack of data structures. I recall using classes and structs and maps and cell arrays regularly without issue in matlab.
- jacobolus 4y agoHave you ever tried to write/debug/use a nontrivial class-based Matlab library? Or one that made serious use of structs, maps, cell arrays (or heck, strings)? There’s really no comparison to any programming language from the past 20 years. Lots of sharp API corners and inexplicable inconsistencies and limitations, gnarly performance overhead even if you know what you are doing and you’re being careful, mediocre debugging tools. It feels like every feature was just bolted on piecemeal and ad-hoc (which they probably were). If you only need to do mix a few scattered lines of non-numerical code in the middle of a big otherwise matrix-heavy project, it’s not too bad. But I feel pretty sorry for anyone trying to use it as a general-purpose programming language.
- throwaway894345 4y agoGood grief, I hated MatLab. I had to use that in my electrical engineering degree. What a user-hostile piece of software.