4 ms·
> everything that happens within it is stateful If that were the case I'd just fix your comment instead of appending another comment after the fact. But that
by mrkeen 6y ago
> everything that happens within it is stateful
If that were the case I'd just fix your comment instead of appending another comment after the fact. But that would make the arguments harder to reason about I think.
> including our code
Do you use git? Or does your team all just edit the same code on a shared server? (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)
> why does the FP crowd make state even more difficult to reason about?
State is difficult to reason about so we maximise out stateless code.
> talking down OOP
I talk down OOP when I treat it as the diff between OOP and FP. That is, coding is 80+% the same whatever you use. It's the last 10-20% where the differences emerge: Lambdas are better than anonymous inner classes. Not having null is better than having null. Not needing to cast is better than casting. Composition is better than inheritance. Stateless is better than stateful. Value-equality is better than reference-equality. Generics + type erasure is clunky without higher-kinded types.
- 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?