MATLAB is not a fully oop yet... why is this?

1 Ansicht (letzte 30 Tage)
Ricardo Prada
Ricardo Prada am 4 Jan. 2012
Dear MATLAB community,
Could anyone tell me why some authors say that MATLAB is not a fully object-oriented programming language yet? They never argue.
Thank you!

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Jan. 2012
MATLAB OOP does not handle multiple inheritance.
Methods are chosen only based upon the first parameter, and not based upon the full signature.
There are some aspects of meta information and dynamic properties that are not really together yet.
Arrays of homogenous objects have to be derived from a specific class, and they have some clunky behaviours.
MATLAB OOP is also measurably slow.
At last glance, it looked like OOP support was not well advanced at all at the Mex level, but I might have misunderstood what I was glancing at.
  3 Kommentare
James Tursa
James Tursa am 4 Jan. 2012
FYI, OOP programming at the mex level is very inefficient. The only functions available, mxGetProperty and mxSetProperty, make copies of the properties instead of returning pointers to the properties. For large sized properties this can be a major issue. I have written a mxGetPropertyPtr routine (in the FEX) that solves part of the problem. Your comments remind me that I need to test and post the other routine I wrote, mxSetPropertyPtr, that solves the other half of the problem.
Ricardo Prada
Ricardo Prada am 6 Jan. 2012
Dear James. Thank you very much for the additional information. I know this is not the right place to ask these kinds of things, but let me ask. Comparing Matlab with Python, which language do you think better deals with OOP, considering numerical computing not an issue?
Thank you.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Titus Edelhofer
Titus Edelhofer am 4 Jan. 2012
Another aspect: you might well stick to the functional programming paradigm in MATLAB, if you like. My personal view would be to call MATLAB in this sense a hybrid language (in some sense like C++ where you can also mix OOP and functional programming, it's neither nor to 100%).
  2 Kommentare
Ricardo Prada
Ricardo Prada am 4 Jan. 2012
Thank you Titus for the extent.
Sohail S
Sohail S am 4 Dez. 2012
Comparing Matlab and C++ is not correct in this sense. C++ is hybrid, but in a different sense, with full ability and efficiency of different paradigms (OOP, generic (template based), structured progrming, system programming, etc). Matlab tries to emulate these practically. However, it doesn't mean either of C++ or matlab is always worse or better (I use matlab)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by