2 ms·
That's bad in Java too: http://thecodelesscode.com/case/115 http://thecodelesscode.com/case/115
by josephcsible 5y ago
That's bad in Java too: http://thecodelesscode.com/case/115 http://thecodelesscode.com/case/115
- ape4 5y agoI see wise Bazen's point. In theory that just replaces `if (obj != null) { ... }` with `if (obj.isInitialized()) { ... }` or similar nonstandard check. But it often makes for nicer and safer code.
- josephcsible 5y agoThat makes the code less safe, because now if you forget an isInitialized check, your code will silently do the wrong thing and start corrupting state, instead of failing early with a detailed stack trace and error.