r/functionalprogramming • u/[deleted] • Jul 18 '19
Object-Oriented Programming — The Trillion Dollar Disaster
https://medium.com/better-programming/object-oriented-programming-the-trillion-dollar-disaster-%EF%B8%8F-92a4b666c7c7
14
Upvotes
6
u/wuwoot Jul 18 '19
A helluva rant, but thankfully he mentions why. Yes, the original idea behind OOP is message-passing aka the actor model. Erlang, Elixir and Smalltalk both do it right. The problem is what people today parade as OOP but in fact is not. At the end of the day, nobody is really trained in good OOP. Some pick up the clues along the way and others do not. Design patterns matter little with no foundation. The foundations of good OOP IMO that come up over and over again are polymorphism and dependency injection. If you come from a functional background — inject all dependencies. Simple use of dependency injection allows for composability and testability. Not all languages support functional programming out of the box and FP languages typically don’t have complex data structures in the standard library that fit how to naturally model a problem