Cogman
Lifer
- Sep 19, 2000
- 10,280
- 131
- 106
I know I must be missing something, because stateless functional programming is a major topic of interest on Hacker News, but how the hell do you create an actual system in that way?
I don't think you can totally escape state.
That said, I do find that more stateless/immutable objects are just easier to deal with (especially in threaded situations).
For an example of how this works well, look at http servers/clients. They communicate by message passing and as a result you eliminate a whole host of concurrency problems.
But even in non-concurrent code. It is usually much easier to reason around an object that never changes after creation.
