3 ms·
OOP isn't out of fashion, per se, I don't think. Inheritance is what really went out of fashion. Part of the problem, I think, is that people use OOP and Inheri
by zaphar 11y ago
OOP isn't out of fashion, per se, I don't think. Inheritance is what really went out of fashion. Part of the problem, I think, is that people use OOP and Inheritance interchangeably too much.
objects are just syntax sugar for a closure or a set of curried functions. As such they are useful. It's inheritance that gave OOP a bad name.
- raiph 11y agoI still recall reading ECOOP papers in the 80s that made it very clear that composition is a much better approach for most things than inheritance (and that a single inheritance mechanism is generally much simpler than a multiple inheritance one). But, while Larry Wall agreed in the sense he put emphasis on features such as roles (cf Haskell type classes) he has also said that there are some important scenarios in which inheritance (and very occasionally multiple inheritance) make coding a solution to a problem more straightforward where use of composition makes it less so, so standard Perl 6 supports both composition (eg roles) and (multiple) inheritance and the compiler (which is written in Perl 6) uses one or the other based on whichever is deemed to work best.