Is there any reason why it's better to use a try/catch statement when one can check to see if a value that is designated to indicate a problem is returned?
For example a function prime factors a number. If a negative integer is passed to it would it be "better" for an exception to be thrown or a particular value returned (that would never be a legitimate value, say -1).
If a function doesn't need to return something would it be less efficient to return true on success and false on failure, as opposed to throwing something?