3 ms·
OOP does not require mutable state. OOP has its origins in imperative languages, and so in the past OOP often involved poor management of mutable state. I am a
by kagakuninja 4y ago
OOP does not require mutable state. OOP has its origins in imperative languages, and so in the past OOP often involved poor management of mutable state.
I am a Scala programmer, and our code mixes OO and FP. Almost all of our classes are completely immutable.
In the end, you will always need to encapsulate data and functions in some manner. The FP approach involves module systems, but as I understand it, objects in Scala actually provide a better module system than found in pure FP languages.