Ryan W Sims:
> The problem isn't how to check it on a case-by-case basis, there are 
> plenty of ways to check that a given pointer is non-null. The problem is 
> debugging _unexpected_ null dereferences, for which a NPE or its 
> equivalent is very helpful, a segfault is _not_.

I don't know what NPE is, but if you program with DbC your nulls are very often 
found out by asserts, so you have assert errors (that show line number & file 
name) instead of segfaults.


> Sorry, didn't mean to reopen a can of worms, just wanted to be clear.

When people that discuss are polite there is no problem in reopening the can 
now and then :-)

Bye,
bearophile

Reply via email to