RE: try - catch is not so clear to me...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc Steinert

> Basically try-catch gives you the ability to handle errors
> outside a class or method scope, by the 
> calling instance.
> This comes in handy, if you are programming in an object
> orientated way and thus enables you to 
> seperate error handling from the rest of your functionality.
> Means, your methods do only the things, they are meant to do,
> without bothering to handling occuring 
> errors.
> Hope, that made things clearer.

You know, this is the first explanation of exceptions I have seen that
actually makes sense. I could never figure out what they were and why
they were. It always looked like it was just a special subset of errors,
a distinction without a difference, as it were. But looking at them as a
technique to move the handlers out of the mainline code actually shines
some real light on the subject.

Thank you,

Bob McConnell

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux