I feel like pure functional programming is the logical conclusion of test-driven development. Programs with a large side-effect-free core are much easier to test in my experience
Conversation
Replying to
Pure OO is supposed to be side effect free too, people just kind of forgot that.
2
3
Replying to
Key part to note is that OOP is basically isomorphic to the actor model, and actors do not affect global state. They only have their own private state. I.e. there is no "impurity" because they can only send and receive messages, they can't go and mutate some global shared state
1
See monte-language.org or erights.org or ponylang.io for what I would consider object oriented as it was originally intended to be
1
Replying to
We might differ on "pure" and "side effect". Check SICP for a great mechanistic explanation.
A functional style only has inputs and outputs. In an OOP style you have inputs, outputs and environment. Message passing encapsulates, but it still mutates an internal environment.
2
2
Replying to
Yes actors have internal state. I don't see how that changes anything though. You can test an actor by giving it messages and seeing how it responds. There is no shared state.
2
If the argument is that you can't just trivially do things like test every possible input and make assertions about its output (i.e. property-based testing) then yeah, that's true. But that doesn't mean OO/actor model is hard to test. It just requires a different type of testing.


