Originally posted by suityou01
View Post
I'm not suggesting you don't handle the ******* exception. I'm comparing try catch, with an exception raised when an enclosed method fails, to calling a method and checking the result to see if it worked or not.
Anyway as i said, semantics is key. If the method is returning null because of an error it should be raising an exception. This may well need to be propogated, and propgating a null value up the call stack is error prone and you lose context so you can't write a stack trace etc. If it's returning null because the answer is null then return null.

unhandled exception

Don't MacOSX, Linux and modern versions of Windows protect against this?
Comment