PHP Best Practices

I’ve been coding in PHP for a new client lately, and while PHP doesn’t have all the glory associated with it that ASP.NET has, nor does it have the compiler or IDE that I love, it is still a fairly decent language to code a website in – but only if you do it right.

For some reason people LOVE to stick a ton of MySQL queries into the middle of their HTML templates, which are also embedded deeply among more PHP code.  Are you guys kidding me?  The people who do this have obviously never maintained their own code, it’s just ridiculous to look at or even contemplate maintaining.

OK, maybe this is sounding too angry of a rant, but this is the reason that PHP Programmers have as bad a reputation as VB Programmers.  I sure don’t want that kind of reputation.

Fortunately there ARE good PHP Programmers out there (no I admit, I’m not the only one!  😉 ).  Isn’t most of Yahoo’s website infrastructure based around PHP?  They must be writing maintainable, scalable code!  So it must be possible in PHP.

There are lots of good, lightweight frameworks like CodeIgniter or CakePHP available out there.  They’re easy to learn, easy to use and make your websites far more maintainable by you and people like me.  It should also give you a bit more developer cred, AND help you get your site out there and online faster to boot!

Sorry for the Code Rage, just trying to get the word out!  As with everything, there is a better, easier, faster way, you just have to look for it and use it!

One Reply to “PHP Best Practices”

Leave a Reply

Your email address will not be published. Required fields are marked *