What I don’t like about object-oriented languages: there are three key ideas that came out of the OO paradigm—one great, one good-but-flawed, one terrible.
- The great idea is abstraction: interfaces.
- The good idea with the wrong default is subtyping. Subtyping is nice—sometimes you want it—but parametric polymorphism is the right default. Think about a function like
list.map
—you want to have anα
list, and then a function that takesα→β
. You don’t want to have an objectlist
, and then a function that takesobject→object
. That’s just wrong.
These mis-features, combined with the verbosity of the languages, make it hard to abstract out simple functions.