3 ms·
> OOP won against functional because OOP is easier to understand and leads to more maintainable code. A couple points: I'm not sure whether OOP really won: pr
by loup-vaillant 6y ago
> OOP won against functional because OOP is easier to understand and leads to more maintainable code.
A couple points:
I'm not sure whether OOP really won: pretty much any language now has taken lambdas & higher-order functions from FP; before those parametric polymorphism (ML was there before C++ templates and Java generics); many sources will tell you to limit mutable state; and even algebraic data types are starting to get mainstream traction (Rust). Speaking of which, I believe Rust does not sell itself as an OOP language?
It is not at all obvious that OOP is easier to understand. Those animal/shape hierarchies are indeed very easy to grasp, and they are also useless. Even games have moved away from class hierarchies, which are both slow and too inflexible. They're more about ECS/data orientation now.
I'm not sure that "easier to understand" does lead to more maintainable code either. If you're talking about daily use, why not. If this is a learning curve thing (and in practice I suspect it is), then I think ease of learning and code quality won't correlate with each other — provided only people who learned the stuff get to program with it of course.
- pintxo 6y ago> Those animal/shape hierarchies are indeed very easy to grasp, and they are also useless. That's a wonderful description.
- narwally 6y agoAs someone that had some background in cladistics, I knew OOP was gonna get real complicated as soon as I saw animal hierarchies as a 'simple' example.