4 ms·
In practical terms, away from the nebulous confusion, object orientation means that the actual function to call must first be looked up in the first argument of
by neokantian 9y ago
In practical terms, away from the nebulous confusion, object orientation means that the actual function to call must first be looked up in the first argument of the function to execute:
x.f(y,z);
<==>
F=ooLookup(x,f); F(x,y,z);
This scheme does indeed allow for polymorphism, but I wonder why we would shoehorn polymorphism into a situation, unless it naturally emerges throughout the programming effort as really needed?
In my opinion, functions should not be polymorphic by default, simply, because there is no reason to complicate things unless these complications truly solve a problem.
Inheritance is then a next complication in which F=ooLookup(x,f) recursively tries to resolve the function from a hierarchical class data structure:
x->class->functions
x->class->class->functions
...
This is even a worse complication, which is even more unlikely to be useful.