Tradeoffs Scala had to make in order to support both FP and OOP

I certainly don’t claim to be an expert on this issue, but I was impressed by the article by Uncle Bob that I posted on your other recent thread. If you haven’t read it yet, I think you will find it worth reading.

https://blog.cleancoder.com/uncle-bob/2018/04/13/FPvsOO.html

Here is an excerpt:

FP vs. OO

Over the last several years I have paired with people learning Functional Programming who have expressed an anti-OO bias. This usually comes in the form of statements like: “Oh, that’s too much like an Object.”

I think this comes from the notion that FP and OO are somehow mutually exclusive. Many folks seem to think that a program is functional to the extent that it is not object oriented. I presume this opinion comes as a natural consequence of learning something new.

FP and OO work nicely together. Both attributes are desirable as part of modern systems. A system that is built on both OO and FP principles will maximize flexibility, maintainability, testability, simplicity, and robustness. Excluding one in favor of the other can only weaken the structure of a system.