Jeff Atwood has an interesting piece today about PHP and it’s horribleness while acknowledging it’s greatness 🙂
Unfortunately Jeff seems to fall into the same trap as many programmers these days. Sure PHP is ugly, it’s got some inconsistencies that make it hard to work with, etc. All of this is very well known and documented.
However, those are all minor issues in the big picture. If you’re trying to build a commercial product or an open source product with major legs PHP is still usually your best choice. Here’s why:
Jeff addresses this, but it cannot be understated. It is literally installed on every hosting platform in the world. There are essentially no mainstream hosting companies where you can’t use PHP.
Ease of Installation
In the very rare cases where PHP isn’t provided for you, getting it up and running is usually about 2 minutes of work. apt-get install php5 and you’re done. Done! No messing with 7 different systems, trying to get x to connect to y. 1 command and you’re done. Even in crazy cases where you need to setup Apache or if you want to go way out there and do Nginx you’re still talking just minutes until you’re ready to go.
In addition to being easy to setup, the default setup is most times very performant with no messing around at all. PHP is designed to be fast out of the box by it’s very nature. No special techniques required. And when you get big enough to need even greater performance those problems have already been solved. A quick search finds you thousands of answers to your performance questions and finding a consultant to help is also easily done if required.
This I think is an area that Jeff really missed the boat on. It’s obvious he hasn’t actually been working with PHP much lately as the tools have gotten so much better. Sure, when I built HelpSpot 7 years ago the tools sucked. You had to do everything the long way.
Now though there are a lot of great tools. We contribute a lot to the open source framework Laravel which is my favorite, but if you like more structure there’s Symfony and Zend Framework. Want something super light? Try Slim. No matter your need there’s a high quality framework that fits it and in most of these cases great documentation and tutorials as well.
Easy for the Newb
“Real” programmers hate this more than running out of Mountain Dew at 4am but PHP is easy for non-programmers. You can get in there and hack around. You can make shit work on your own without asking for a lot of help. That’s simply impossible in most languages. My 60 year old father hacks around WordPress all the time. If it was Python and he had to get all his tabs right it’d never happen, but in PHP you can just go in and “do stuff”.
I know you’re all cringing out there right now, but this is good! So what, maybe once in a while something breaks or his WordPress install becomes slightly less secure. It’s empowering and enabling people that other languages cast aside.
It’s Not About You!
Obviously in recent years certain frameworks and languages that we all know have gotten a lot of props for being programmer friendly. That’s great, but the reason PHP is so successful is because in the big scheme of things that doesn’t matter. PHP is about the above. It’s about being powerful enough for pro’s and simple enough for newb’s.
The reason it hasn’t been supplanted yet is because no languages have attempted to do the above. In fact, most seem focused on becoming programmer friendly while ignoring the above completely.
So Jeff, I hope your new project is going to highlight a lesser known language that accomplishes the above as that’s the kind of language we need to replace PHP. Not one only for the Mountain Dew crowd, but one for the people.