News Feed
Sections




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

Ivo Jansch's Blog:
Defensive Programming
January 27, 2006 @ 07:01:48

In his latest blog post today, Ivo Jansch takes a look a t a situation where a little "defensive programming" would have helped.

A few weeks ago, we had a major problem with software we'd written for a client. It was software for sending mailings to the client's customers. Suddenly there were many reports of clients receiving multiple mailings instead of just one.

The problem appeared to be in our test code. The software had a 'test' mode for testing the mailing by sending it only to the author and a small test team. It appeared that for some reason, all test mails were being mailed to the customers as well.

This problem would not have appeared if we had applied what I would like to call 'defensive programming'.

He shows code examples from this situation, pointing out where the issue lies - a bad check in an if() statement.

0 comments voice your opinion now!
defensive programming error situation defensive programming error situation


blog comments powered by Disqus

Similar Posts

Matthew Weir O'Phinney's Blog: The light has not set on PHP

PHPMaster.com: Error Logging with MongoDB and Analog

DevShed: Error Handling in PHP - Introducing Exceptions in PHP 5

Nick Halstead's Blog: PHP Competition Results - Third Place (Karol Grecki)

Nick Halstead's Blog: PHP Competition Results - Second Place (Evan Chui)


Community Events

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


voicesoftheelephpant library application community conference laravel api php7 podcast release symfony2 opinion example performance configure framework series language introduction interview

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