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 not lore, it's most definitely a fact I can attest to (tho' agreed on bad languages). Overriding by definition scatters domain logic over the inheritance hierarchy, and anything overridden is behaving differently in a subtype by definition, which causes its own bugs.
-
Inheritance without laws sucks no less than typeclasses without laws or parameters without laws. The problem is lack of laws. Document your laws in the trait that introduces the methods. Override the algorithm for a speedup but don't contradict the laws — or use distinct names.
- 1 more reply
New conversation -
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!