On 21/10/14 23:51, Andrea Faulds wrote: > I am gradually warming to throwing an exception. An interesting idea I’ve had > suggested on Twitter was by Matt Parker, who suggested that I add an optional > 2nd argument. Without the argument, it throws an exception. With an argument, > it returns that value (as a default) instead of throwing an exception.
Now that sounds like a nice compromise in a few places where exceptions have been introduced, but I still think this is still a little chicken and egg. If it is going to 'fail' then the reason for the failure is more important than simply producing no answer. Especially if it is going to fail in different inputs to other methods. Again forcing an exception only solution sidesteps that debate! -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php