In my experience, a programmer saying they actually like MATLAB means they either know very little about general programming, are not primarily a programmer but an engineer or have been pidgeonholed into doing just one thing that MATLAB does okay for quite a while.
The language is ugly and some relatively normal features are horribly clunky to use (object-oriented stuff, GUI primitives, ...), antiquated syntax that reminds me of BASIC. If you used any moderately modern language, (C++, Java, JavaScript, Python, Rust, Nim, ...) or even old ones like C, Lisp, Haskell - you just cannot like it.
My favorite thing about Matlab is it has both i and j defaulted as the imaginary unit, but will silently let you overwrite those values. I'm not saying that's an invalid design decision, but it doesn't really make sense to spring on the intended audience: physicists/engineers/etc who don't really have a programming background but need to be able to code some simulations. That crowd is often going to want to basically just type in the equations in their textbooks (hence reserving both i and j for the imaginary unit—in electrical contexts, i is current, so they use j for the imaginary unit), which will often result in looping over ijk indices since those are what textbooks usually use for 3D vectors/matrices. That crowd will also typically not have the background to realize the potential problem here.
I found out about this via someone on reddit saying that they spent an entire summer pulling their hair out trying to figure out why their complex equation was returning a pure real result and finally figured out it was because he'd used i as a loop variable and instead of being reset to sqrt(-1), it was staying as the last value it hit while iterating through the loop. If they want to keep the behavior they should really at least print a warning about what you're doing to the console.
Again, Matlab is targeted at non-programmers, which is the kind of audience you might expect to assume that the scope of the ijk being used as loop variables is restricted to the loop.
This isn't really specifically about programming. In math and physics textbooks, you often see the unit vectors given as i j and k (instead of x y and z); vector/matrix indices will often be given ijk in a subscript; you'll often see triple summations with i on one, j on the second, and k on the third; etc. So the audience Matlab is intended for is going to want to loop over ijk (xyz) since it matches the notation they're used to using.
What you are saying is contradictory. If everyone assumes i, j, and k are the orthonormal basis vectors for R3, then they obviously wouldn’t loop over them, because what the hell does it mean to “loop over” a basis vector? On the other hand, if everyone assumes i, j, and k are undistinguished available names for integer variables, they’d happily loop over them but wouldn’t think to use them as an orthonormal basis for R3.
But you’re mixing and matching, it seems. You seem to be saying that since STEM people see i, j, and k in textbooks used as basis vectors, it follows that they would assume i, j, and k are ineger iterators in loops. That’s a total non sequiter.
In a sane language, if i is the imaginary unit, it is write protected. I mean, there are a lot of un-sane languages according to this definition, but most CAS’s get this right, at least.
426
u/Stereoisomer Aug 05 '19 edited Aug 05 '19
In my experience, a programmer saying they actually like MATLAB immediately attracts every python dev in a five mile radius
Edit: someone edit this meme and post here for a karma double-dip I’m too lazy