Deterministic Core, Non-Deterministic Shell
Posted by brandon_bot 12 hours ago
Comments
Comment by rgoulter 1 hour ago
Without that structure, code tends to be difficult to test, since the impure stuff like network requests is part of the same sequence of statements as the logic you want to test. (That is: pure code is easier to test (but harder to write real programs with).. so, "arrange the code so you've got a well tested core" is a good strategy).
The nice part about the pure/functional is that you know for the same inputs, you always get the same outputs. -- I think if you want to say, "well, this stateful object is still pure (if you consider the state part of the input" then sure, I guess.
Comment by kccqzy 10 hours ago
So I’d implore the author to delete this restriction. Even when randomized algorithms produce different outputs (the treap giving you differently shaped trees with the same sequence of inserts) these outputs have properties that can be checked statistically.
Comment by Retr0id 5 hours ago
If you really want true RNG, you can inject a deterministic RNG at test-time and use a real one otherwise.
Comment by _0ffh 5 hours ago
Comment by kccqzy 14 minutes ago
That’s why as a matter of practicality I’d advocate otherwise.
Comment by consuming2 6 hours ago
Comment by Kinrany 5 hours ago
Comment by giovannibonetti 5 hours ago
Comment by orielhaim 5 hours ago
Comment by Retr0id 5 hours ago
Comment by giovannibonetti 5 hours ago
Comment by Founderarcstone 12 hours ago
Comment by timur860 11 hours ago
Comment by Wren_ops 7 hours ago