2 ms·
Using non-nullable types aggressively helps a great deal. You don't need to trust that your code doesn't have timebombs; the compiler can verify that those obje
by tantalor 11y ago
Using non-nullable types aggressively helps a great deal. You don't need to trust that your code doesn't have timebombs; the compiler can verify that those objects are always non-null. You can continue to use nullable types as simple form of "maybe"; no wrapper object is necessary. When most of your objects are non-nullable then the nullable cases are noticeable, and you know when you need to handle the null case and when you don't.
In JavaScript, for example, Closure Compiler and Flow both support non-nullable types.