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.
- Handle unexpected conditions
- Process external systems data properly
- Test your code
- Monitor your site errors and act upon them
- Do not disclose errors to the users
- Damage control
- Backup
- 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.