[wp-hackers] Why WP_Error Sucks

Ryan McCue lists at rotorised.com
Wed Jul 25 06:57:45 UTC 2012


Michael D Adams wrote:
> Joel Spolsky's opinion:
> http://www.joelonsoftware.com/items/2003/10/13.html (Exceptions are
> worse than GOTOs)

While I'm a big fan of Joel's writing, I don't always agree with him on
his topics. This is one of them.

Not knowing whether a function is going to throw an exception seems to
me like more of a documentation issue than anything else. I think that's
definitely solvable, especially given WordPress' fairly good PHPDoc that
we already have.

Also from the article:

> It is true that what should be a simple 3 line program often blossoms to 48 lines when you put in good error checking, but that's life

I disagree that it has to be this way. We're using a modern high-level
development language with these features built in.

-- 
Ryan McCue
<http://ryanmccue.info/>


More information about the wp-hackers mailing list