3 ms·
In theory, I think the article is correct. Yet in practice, I've found that it's easy to over-model things that just don't matter. The number of potential stat
by iamcalledrob 10mo ago
In theory, I think the article is correct.
Yet in practice, I've found that it's easy to over-model things that just don't matter. The number of potential states can balloon until you have very complex types to handle states that you know won't really occur.
And besides, even a well modelled set of types isn't going to save you from a number that's out of the expected range, for example.
I think Golang is a good counter example here -- it's highly productive, makes it easy to write very reliable code, yet makes it near impossible to do what the author is suggesting.
Properly considered error handling (which Go encourages) is much more important.