Why I don’t code in PHP (yet)

I should preface this post by stating that I’ve been a Microsoft developer for most of my development life. Sure, back in the 80’s I wrote code on an Apple, but that was over twenty years ago. Any development I’ve done within the last ten years or so (in other words, my entire professional life) has been out of Microsoft.

I’ve found recently that I’m starting to evolve in my coding practices. At first I coded in ASP, which is a VB derivative, but within the last two or three years I’ve migrated into .NET. My language of choice was VB.NET, for a few reasons, not the least of which was the comfort level involved. Lately however I’ve found myself migrating into the realm of C#.

Recently I started playing around with development within Linux. It was a path I’d always wanted to travel, but until the advent of software such as VMWare it had always been prohibitive for me to do so - I either needed two computers (so that I could still use my Windows apps) or I needed to set up dual-boot, a process which is at best an inconvenience and at worst a potential danger to both operating systems. With VMWare I could work in my native Windows environment and still access a Linux session with just a click of the mouse.

Once I set up Linux, I set up a LAMP server (Linux-Apache-MySQL-PHP) and started playing with PHP development. I’d heard so much bragging on it, how it was the wave of the future, that only real web developers used PHP, etc. Quite frankly, so far I’m not that impressed.

Let’s be frank about something. PHP is a pretty nifty development tool, but at its core it’s simply a scripting language just like ASP.

I’m not saying it’s identical, by any stretch of the imagination. Certainly the language structure is different. But the actual scripting element is so close that I don’t see any benefit whatsoever for using it over ASP - certainly not any performance benefits. There’s nothing you could code in PHP that you couldn’t code in ASP with pretty much the same performance.

What PHP needs in my opinion is to start moving out of the realm of a scripted language and into a compiled structure. I hate bringing up Microsoft examples, but they’re what I know - PHP should do basically what .NET did for ASP: Separate the client-side from the server-side, and compile the server-side code into a binary which is then used on the site. It would reap huge benefits in both cleanliness and in performance.

Several of the “stupid javascript tricks” that scripting developers use to keep information constant throughout their app would be built automatically in the back-end - no more do you have to worry about front-loading the session with all your variables, or passing your variables via hidden form entries - your variables would persist from page to page.

Please keep in mind that these are first-blush estimates, and that perhaps as I work more with PHP I’ll warm up to it. For the meantime, however, I really don’t see the benefit to coding in PHP unless you’re place in a situation where you absolutely must.