Discussion on: OOP vs Functional Programming

kant312 profile image
Quentin Delcourt

To me OOP is not about encapsulating state (although you can do that of course), but rather encapsulating data with behaviour. The fact that these data should be immutable or not depend on the software needs, but I think most of the time we should err on the side of immutability.
TL;DR, I don't think using OOP should force you to have mutability everywhere.

Thread Thread
lifelongthinker profile image

Where's the difference between state and data? I think we are talking about the same thing here.

No, OOP doesn't force you to have mutability. Rather, OOP emerged to satisfy the need for managing mutable state carefully.