3 ms·
> It's really hard to test non-determistic code. I'm willing to eat a lot of pain at design time to avoid doing so. Ironically, this is a lot easier if you uni
by Supermancho 4y ago
> It's really hard to test non-determistic code. I'm willing to eat a lot of pain at design time to avoid doing so.
Ironically, this is a lot easier if you unit test the non-deterministic parts. Once you can be sure it's easily testable[1], it also has the side effects of being easier to debug, read, more reliable (in terms of branch behaviors), and more readable. Writing longer functions (his leaning) makes these issues worse, so it's not surprising it's a pain point.
[1] Granted, this depends on language. Each language has different language features that make code more or less testable, from a unit testing perspective.
- deleted 4y ago[deleted]