Hi! > Have you stopped for a moment to think this opinion through? Look at two
Of course not. Why would I bother thinking? It is always safe to assume nobody thinks before writing anything to the list. > typical patterns of error handling. The examples below are generalized from > my file cache code. Having no cache is exceptional, because 99.999% of the > time I run this, there is cache, except the first time when there's not. > > Tell me again how you using try..catch is very verbose and how you need to > supply multiple catch blocks for "every kind of exception possible"? You are either purposefully exaggerating or not doing it right. if(fileop1() && fileop2() && fileop3()) { // do valid stuff } else { // do error stuff } It's not that hard. > With exceptions: > ---------------- > try { > fileop1(); > fileop2(); > fileop3(); > normal_actions(); > } catch (IOException $e) { > exceptional_actions(); > } Now imagine fileop1 throws some other exception - note that you have no idea which exceptions are there and nothing guarantees you fileop1 throws only IOException, and by the proposal here, any problem in any code whatsoever results in exception now, even if the problem was in converting log message to utf-8 while writing some log inside some function called by fileop2(). Now your whole app has failed, even though you don't really care about that log message at all. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php