News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

The PHP.cc:
Urban Legends and Error Handling
June 27, 2013 @ 09:23:16

In this new post to the PHP.cc blog, Stefan Priebsch looks at the relationship between urban legends and error handing in PHP.

Ending up in such a situation [as the tourists in the urban legend] is not the fault of the underpass: the error, made somewhere upstream, merely shows up right when approaching the underpass, and is usually difficult (or at least tedious) to handle. PHP as a programming language, just like any dynamic language, may at first appear to not need overly strict validations of data. Validation of data, however, is directly related to error handling: If data is invalid, this should be an error or an exception (if you write OOP code, which you should be doing). This error needs to be handled somewhere.

He talks about how things like field and value validation can help prevent errors further down the road. He mentions the split between application and domain logic and suggests that it's the role of the app logic to prevent bad data from making it thorough to the domain.

In software development, it is crucial that you handle any errors as soon as they occur. This requires you to actually realize that an error has occurred.
0 comments voice your opinion now!
urban legend error handling domain application logic validation

Link: http://thephp.cc/viewpoints/blog/2013/06/urban-legends-and-error-handling

blog comments powered by Disqus

Similar Posts

Jim Plush's Blog: Followup on rethinking Zend Models with DDD - Framework code included

Greg Szorc's Blog: Using DTD's and Catalogs for XHTML Validation

Bill Staples' Blog: Quick Install of the World’s Most Popular Web Applications on IIS7

Raphael Stolt's Blog: Validating XML files within PHP 4 applications

PHPMaster.com: Localizing PHP Applications "The Right Way", Part 3


Community Events











Don't see your event here?
Let us know!


introduction hhvm component unittest symfony2 facebook composer database language framework package support podcast opinion hack security install application release performance

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework