News Feed
Sections




News Archive
feed this:

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

PHPClasses.org:
8 defensive programming best practices to prevent breaking your sites
April 26, 2007 @ 11:11:00

As anyone who's been developing applications (web or otherwise) knows, there are certain things that you just don't do when you're doing things like adding features or changing the code of a production application. There are some general rules to follow and this new article on the PHPClasses.org website reminds us of just a few.

This article describes software development practices that have been used to prevent problems that can break Web sites.

Included in his list are things like:

  • Handle unexpected conditions Test your code
  • Monitor your site errors and act upon them
  • Do not disclose errors to the users
  • Do what you can as you can never get defensive enough
He also recommends two resources for some additional reading - the Wikipedia entry for "defensive programming" and a chapter from Getting Real (from 37 Signals) about how to "Get Defensive".

0 comments voice your opinion now!
defensive bestpractices break site defensive bestpractices break site


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



Community Events





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


library bugfix developer install code list api introduction configure application language framework podcast threedevsandamaybe release community laravel wordpress series interview

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