Re:Was object-oriented programming a failure? (2015)
by rdnetto on Tuesday March 14, 2017 @06:56PM
(#13872281)
A counter-point to this is that OOP languages lack support for ad-hoc polymorphism. i.e. the ability for third-party code to define an implementation of an interface for a pre-existing type. The two approaches used to work around this are the adapter pattern, and explicitly taking an object implementing the desired behaviour as a second argument (e.g. Comparators in Java).
In contrast, most (typed) FP languages support typeclasses / traits, which makes a lot of code considerably simpler.
In contrast, most (typed) FP languages support typeclasses / traits, which makes a lot of code considerably simpler.