3 ms·
I fail to see the problem: A NPE is thrown if the code tries to access an object, but there's no object.Using a standard behavior here would conceal that there'
by sgift 17y ago
I fail to see the problem: A NPE is thrown if the code tries to access an object, but there's no object.Using a standard behavior here would conceal that there's a flaw in the program logic.
- cema 17y agoThat there is no object is the problem.
- dkersten 17y agoAgreed. The flaw in program logic is that there is no object. Very often, it makes no sense to not pass an object somewhere where an object should be passed. Having null pointers makes it easy to live with this logic bug, when it should never have happened in the first place.