Re:New Features in Java 14
by lmm on Tuesday March 03, 2020 @09:26PM
(#22480698)
For the case where something really could be absent, you're right; it's the same amount of code. The difference is that in a language with null you have to write that code for every single function parameter, whereas in Rust you can have required parameters that are actually required and only need to check the genuinely optional cases (which is what, maybe 5% of the time?). Make invalid states unrepresentable.
[ Parent
| on HN ]
There are no comments on this comment yet.