Mike Bernat has come up with a list of (eight things) his best practices when it comes to PHP development:
I suggest a more retro-active approach [than trial and error]. Studying, surrounding, and forcing yourself to abide by best-practice coding standards will yield surprising results in your applications despite the fact that it may seem like more work than it's worth.
Topics included in his list are things like:
- Always develop with error reporting set at E_ALL and E_STRICT
- Portability, Portability, Portability!
- Don't over-think!
- Validate & Sanitize your Inputs!
Check out the rest of the post for more suggestions and explainations.