3 ms·
One of the problems with Matlab is that it does not encourage any sort of partitioning scheme for code. It even makes the simplest form of partitioning (functio
by Derbasti 13y ago
One of the problems with Matlab is that it does not encourage any sort of partitioning scheme for code. It even makes the simplest form of partitioning (functions) excruciatingly frustrating by requiring them to live in their own files--thank god there are subfunctions, nested functions and anonymous functions.
But there is still no notion whatsoever of namespacing, modules or a usable class hierarchy. It is thus very hard to organize code in a modular manner. Matlab actively encourages globally-scoped script files and long long functions. This makes constructing medium to large sized systems very painful and error prone.
TL;DR Matlab is fine for a single script or two. But anything larger than that is immensely complicated by it's lack of code organization.
- jordigh 13y agoYes, the fundamental problem of the Matlab language is the namespace problem. The hilarious thing is that basically every feature added to the Matlab language since the beginning has been an attempt to control the namespace problem, and they still can't solve it. Besides subfunctions, nested functions, and anonymous functions (and does anyone using them actually understand all of their scoping rules), you have old style classes, new style classdef, packages, and sometimes case-sensitive and sometimes case-insensitive identifiers. It's a mess. And I don't think it will ever get fixed.
- Derbasti 13y agoI usually find nested functions and closures to be more pleasant to use than Matlab's class system. A sad state of affairs, really.