Hacker News new | ask | show | jobs
by hepta 3469 days ago
> Maybe passing around a random generator explicitly is not what we want.

That's fair. What I often want is to pull a function out of my program and test it without a lot of work. This is easy if the function is pure.

> My point is that hidden state is not bad when the explicit simulation of state is cumbersome to use.

That depends on your goal. If your intention is to make state explicit, then by definition there has to be more code to make it so. Again, a preferable abstraction for this makes the boilerplate go away, while keeping everything pure. That added effort gives you testability but I know there are instances where that effort is not worth it.