3 ms·
I 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 s
by raiph 11y ago
I 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.