I've been thinking about this a lot lately. I had a discussion about this (e.g. the never-dying OOP vs FP -- which is better argument.) yesterday with a colleague. My current state of mind:
- OOP and (Actor-Model-based) Functional Programming allow for a similar amount of abstraction and conciseness in programs.
- The features in (Actor-Model-based) Functional Programming (immutability, pattern-matching, real concurrency without deadlock-dangers) allow you to write programs that are much faster than the alternative in OOP-programs.
- There are a lot less ways in (AM-based) FP to shoot yourself in the foot than in OOP, because patterns like Demeters Law or tell, don't ask resolve themselves naturally when working with processes/immutability.
I don't remember who, but someone showed me this image a while back:
Basically, there are less patterns to learn, because most problems we face in Object-Oriented design resolve themselves in the functional world.
The hardest thing is to change your mindset from a I have this data and I want to put them in a hierarchy of objects to I have this data and I want to write functions/processes that consume it.
Of course there are nice features like Polymorphism, that some claim only exist in OOP-land, but I'd argue that that isn't true; In Elixir we have Behaviours and Protocols to fill this gap, and they work great at allowing code-re-usage and 'swapping out components'.