Defensive Programming Best Practices (in PHP)

Manuel Lemos of PHPClasses.org writes about his eight defensive programming best practices focusing on the context of PHP/web newsletter delivery system.

  1. Handle unexpected conditions
  2. Process external systems data properly
  3. Test your code
  4. Monitor your site errors and act upon them
  5. Do not disclose errors to the users
  6. Damage control
  7. Backup
  8. Do what you can as you can never get defensive enough

This is definitely worth everyone’s time. I highly recommend this for budding PHP developers as well as those with higher-level experience. By the way, you can vote for his post on digg.

RSS feed for comments on this post · TrackBack URL

Leave a Comment