3 ms·
> The OO solution here is to make state 'private'. It supposedly doesn't really matter than you're all editing the same documents at the same time, because they
by spankalee 6y ago
> The OO solution here is to make state 'private'. It supposedly doesn't really matter than you're all editing the same documents at the same time, because they're behind getters and setters
This just isn't true in the slightest sense. Honestly, where does this kind of anti-OOP trope come from?
- mrkeen 6y agoIt isn't a direct bashing of OOP. It's a bashing of the claim (see wiki quote) that you can make state manipulation safe by hiding it away inside a class. Encapsulation Encapsulation is an object-oriented programming concept that binds together the data and functions that manipulate the data, and that keeps both safe from outside interference and misuse. Data encapsulation led to the important OOP concept of data hiding. It's arguably the core concept of OO, and I don't believe it keeps data 'safe from outside interference and misuse'.
- jtdev 6y agoSo doesn't FP make similar claims about mutation, i.e., "make state manipulation safe" through mechanisms like closures? How/why are closures considered more palatable?