3 ms·
>My answer to that is that even using a dynamically typed language I don’t have to write the test for nil because I know that nil will never be passed. I don’t
by coldtea 7y ago
>My answer to that is that even using a dynamically typed language I don’t have to write the test for nil because I know that nil will never be passed. I don’t need to make states unrepresentable, if I know those states will never be represented.
If only programming actually worked this way... You can never know what "will never be passed" unless you prove it, and types offer that proof.
Tons of bugs in languages that allow null to break their type system, for example, concern null pointer dereferencing...