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.
-
-
Replying to @jdegoes
I call bullshit on that. I use trait inheritance all the time for my (type)classes. Enriching data structures by adding new operations out refining existing ones, adding or refining cases, fields, etc., is a great way to incrementally define libraries.
3 replies 0 retweets 6 likes -
Replying to @Ngnghm
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.
3 replies 0 retweets 1 like
Just last week, I had to do truly ugly things abusing the OCaml module system to do things that would have been so much cleaner and more extensible with (type)class inheritance in Scala. I also lost covariance, and now need to explicitly instantiate a module for every variant.
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!