[wp-hackers] Why WP_Error Sucks

Ryan WP Mailing Lists ryan.wpmailinglists at gmail.com
Tue Jul 24 17:30:22 UTC 2012

I guess given my experience with .net I was tought exceptions so I really
don't know better I guess. I also don't really understand WP_Error. Does
anyone know of a good overview of it I could have a look at?
On Jul 24, 2012 8:33 AM, "Brian Layman" <wp-hackers at thecodecave.com> wrote:

> While I won't say I hate them, I agree completely with Otto that
> "Exceptions should be exceptional". When you look at the extra load an
> exception handling adds to your program, you realize that they should be be
> avoided at almost all cost.  Unfortunately that means a lot of extra effort
> on our part to actually do things right in the first place - adding the if
> statements to look for what will cause the errors and building the logic to
> properly handle the work flow.  The problem is that this kind of coding is
> work and not fun. It's tedious.  Additionally each time something comes
> through and is raised as an exception, that means there is more code you
> need to write to fix that exception.
> I've not seen any performance tests on PHP to show the speed difference of
> if blocks vs exceptions, but I would be shocked if PHP somehow handled
> exceptions with more efficiency than any of the other languages I've worked
> in.
> Brian Layman
> ______________________________**_________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
> http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>

More information about the wp-hackers mailing list