One of the most self-aware learnings to come out of OOP is "favor composition over inheritance". Even in OOP, inheritance is an anti-pattern. All roads lead to FP.
-
-
It's pretty widely accepted in OOP that implementation inheritance should not be favored if composition is feasible. Implementation inheritance leads to scattering out domain logic over a hierarchy, bugs due to violations of implicit contracts, and other issues.
-
This is lore from bad languages that are so lacking that developers abuse some language features as poor substitute to achieving other features. As in, using products and nulls to emulate sums. But it also applies in reverse, with FP abused to mimic OOP when unavailable.
- 3 more replies
New conversation -
-
-
Ad hoc polymorphism is complementary to parametric polymorphism, not opposed to it. I'll offer my Lisp Interface Library as a witness. What next, products but no sums?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
But you can have typeclasses without inheritance...
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Read my blog!