Re: Some PEAR remarks
| From: | Martin Jansen | Date: | Thu, 18 Apr 2002 08:42:03 +0000 |
| Subject: | Re: Some PEAR remarks | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1174@lists.php.net to get a copy of this message | ||
On Wed, 17 Apr 2002 13:11:59 +0200, Vincent Oostindie wrote:
>And what about production-state code? That kind of code doesn't contain
>any programming errors, so then there's no need to check for them.
Even systems that have been running stable for a long time tend
to crash one day: Imagine that your SQL server has some hardware
problem and PHP can't establish a connection. If there was no
error handling in your scripts, the application would die with
an error message like "Warning: MySQL Connection Failed: Can't
connect to MySQL server on ...". Do you really want to show that
to your customers? I certainly don't :-).
>Class DB is the entry point to creating connections to any kind of
>database. How many applications need that much abstraction?
Some programmers not only use PEAR DB because of it's abstraction
features, but also because the interface provides them an smart
way to work with databases: The API is easy to use and manages
the whole error handling itself - lazy programmers don't need
to care very much about catching errors. And when it finally
comes to the point where they have to switch to another DBMS,
they can easily do that because they have been using a more
or less database independent API all the time.
- Martin
--
Martin Jansen, <mail@martin-jansen.de>
http://www.martin-jansen.de/