2 ms·
> Is the missing data just not appearing better than a 'oops, something went wrong' error or similar in response to a 500 caused by an NPE? No, but with checke
by boomlinde 7y ago
> Is the missing data just not appearing better than a 'oops, something went wrong' error or similar in response to a 500 caused by an NPE?
No, but with checked unions like optionals, "not appearing" is a behavior that you explicitly chose to implement. Checked optionals force feed every opportunity to address and amend the error to the programmer. Null pointer exceptions bubble that far up either because the programmers didn't consider all the failure modes caused by implicitly nullable types or because they truly don't care. With checked exceptions, you have limited this to just the "truly doesn't care" category because the programmer is forced to consider every failure mode at every point in the call chain: "not appearing" in that case doesn't happen by mistake but by explicit choice.