News for hackers. Stuff that matters.
Re:Case against OOP is understated, not overstated (2020) by brabel on Friday February 11, 2022 @02:18AM (#30298096)
With mutable state, your function mutates state somewhere in the environment (typically a global variable or the class in which the function resides). With immutable state, your function returns an immutable value, never modifying anything. I program Java for the most part, and this is how I do most things. Mutable state is the enemy, not OOP. Some people think mutable state and OOP are inseparable but they are just looking at a definition of it that is easy to criticize. If you make every object immutable , OOP actually becomes a much nicer model to work with.

There are no comments on this comment yet.