39 ms·
I never got the Java argument. I would much rather fail early and noisily with an NPE than return false and let my program happily chug along when it wasn't exp
by megawatthours 10y ago
I never got the Java argument. I would much rather fail early and noisily with an NPE than return false and let my program happily chug along when it wasn't expecting a null. If the value is intended to be nullable, I would use an optional.
- xxs 10y agoJava8 optional is way slower (write a tree alike struct with optional for left/right/parent) and null checks are one of the free ones. (Hardware optimized)
- brianwawok 10y agoWell for 95% of Java's live, there was no such thing as Optional. So say untrusted user input.. many cases where it could be something or null. Yoda checking it was a nice way to save a null check.