> . . .For example, if you try to
> open a file and the file isn't there, throwing exception is a very
> annoying behavior (yes I know some languages do that, IMO it's wrong).

Because checking that the returned variable is `!== FALSE` is *way*
better than throwing an exception, right?

This type of thing is one of the main reasons I like PDO more than
MySQLi.  In MySQLi I'm constantly checking return values.  In PDO I
just wrap it all up one try/catch.  It's not like if my query fails
I'm going to try a different one.  Most of the time it's just logging
that something went wrong and reporting it upstream somehow.

I understand that opening a file is a bit different than querying a
database, but I have to disagree with your entire previous post.
Exceptions are much nicer than errors.

Of course, everyone is entitled to have and express their own opinion.
I'm just sharing mine.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to