DEV Community

Discussion on: The fight between Try-Catch and If-Else

Collapse
 
moopet profile image
Ben Sinclair

In certain systems - terrible, heartbreakingly-awful systems - I use try.. catch instead of ifs, against those system's best practices.

If your ifs need a dozen conditions to get a single value out of an object, and you can do the same by handling an exception... go with the exception.

It's more readable, for one thing.

I know it makes it harder to track down what went wrong when something goes wrong. I know it pongs a bit.

But life's too short for entity metadata wrappers.