4 ms·
Seems reasonable. Null pointers are rumored to have cost billions in waste and failures. And they're trivial to fix with a little bit of static typing.
by dons 17y ago
Seems reasonable. Null pointers are rumored to have cost billions in waste and failures. And they're trivial to fix with a little bit of static typing.
- chancho 17y agoNot sure I would call it "trivial." You just trade your segfault (or NullPointerException) for a pattern match error. Although that little bit of static typing would probably have dealt with the vast majority of expensive null-pointer bugs.
- kscaldef 17y agoThe pattern match error can be detected at compile time. The NPE is not.
- Niten 17y agoWell, trivial in relation to a company rebuilding its product on a new programming language or paradigm.
- camccann 17y agoNot if you enable compiler errors for inexhaustive matches. Are there any compilers for mainstream languages that can flag all possible segfault/NPE locations as errors?
- wlievens 17y agoThat's probably an intractable problem.