News for hackers. Stuff that matters.
Re:Anti-if: The Missing Patterns by thaumasiotes on Friday June 10, 2016 @01:34AM (#11874492)
Well, no, you still need the null checks. You've eliminated null pointer exceptions by guaranteeing that null is always checked for before the value is used -- you're still checking, but you're now immune to unanticipated crashes. (That would have resulted from null dereferences, that is. You can still have other bugs.)
Re:Anti-if: The Missing Patterns by lmm on Friday June 10, 2016 @10:14AM (#11876469)
You need checks but only in the cases where you need checks. More importantly, nullable values are very obvious in the code (and should very much be the exception rather than the rule), so the cases where you need to think about "what if that's null" are cases you actually think about.