Why I never use PHP
by James
I haven’t used PHP for any kind of web development for three years: here’s why.
PHP is ugly
Open brackets, close brackets, semi-colons, parentheses: PHP has too much language “noise” for my taste. Languages like Python have shown that it’s perfectly possible to treat whitespace as a formal part of your syntax, and even if you’re not a fan of indenting, there are other choices out there which don’t force you to use lots of special characters.
PHP is difficult to read
Following on from the language noise point, I find PHP code more difficult to read than, say Ruby — mainly because of the extra characters. This is a really important point for me: I want to be able to read code naturally, in a similar way to English, because, well, I’m lazy :)
Joking aside, I think the barriers to learning a new language are lowered when reading the language is as close to reading English as possible (for English speakers).
PHP is old
PHP feels like an old language. Maybe in five years I’ll be saying the same thing about Ruby! I’m not saying the PHP is out of date, just that it feels weighed down by a lot of the programming languages defaults from five or ten years ago.
PHP is not dynamic enough
I know PHP has object-oriented programming, but I’ve been spoilt by Ruby’s meta programming abilities :) It’s nice to be able to define methods on the fly, while some code is running. There’s a level of introspection with Ruby that I never got with PHP.
Conclusions
I freely admit that this is personal opinion: PHP is a well respected language, plenty of people use it, and I think it’s great for hacking together apps that will work on almost any server without much fuss (Shaun Inman’s Mint, which I’ve recently installed, is a good example — it works on almost any server that has PHP and MySQL. I can’t imagine him having written it using Rails!).
But personal tastes are all that matter when it comes to your own work, and personally, I’m happy that I don’t have to see all those brackets every day :)
[...] Up to now, I’ve been avoiding digging into Depo-Skinny’s PHP code because, well, I don’t like PHP [...]