a companion discussion area for blog.codinghorror.com

The PHP Singularity


Wow. I haven’t seen a double claw hammer in years. As Lukewelling pointed out, the double claw hammer is a fairly bad example for this kind of discussion and referencing said hammer and pointing out its failure to hammer nails illustrates is misunderstanding of how to properly use said tool.

This makes no allusions or any kind of commentary on coding ability/etc. Just a commentary on the choice of non-coding illustrative example, which can be summed up and applied to many things in life: just because you don’t understand the usefulness of a tool, does not make it useless.


I agree with lphuberdeau. Not mentioning great frameworks for PHP seems unfair.


PHP isn’t popular because it’s easy, it’s popular because people using it are more interested in getting things done that debates about syntax.

Truth is despite the chaff if you’re interested in writing good code in PHP you can. The rest is bull, to be blunt.



Just as many people would cheer the death of Nickelback, many would cheer the death of PHP.

I can think of a handful of choice languages as the basis to build an alternative. I’m guessing that you’re going to get your most support from the community that has grown up around that language.

So, out with it - how are planning to break up the band, Yoko?


Um, Jeff, you do realize that you built your sites on the Microsoft stack and ASP.NET, right?

You look at PHP and you sneer. A lot of people coming from the open-source stacks would sneer at ASP.NET … viewstate hidden fields, really? (Yeah I realize they have improved since then.)

Don’t get me wrong. I think Ruby and Node.js are the shiznit. But just like any other language, once you get used to PHP, you can do some amazing things in it. I am not talking about Wordpress, Drupal, Joomla, and user adoption. I am talking about making web applications that regular people can host, where you change one file via ftp and they are instantly updated without having to restart your server. I’m talking about isolated scripts so one request can’t crash the server, about about class autoloading so they can just drop in a library and it works, about include( ) where and so forth.

Of course, it doesn’t help that most frameworks in PHP are just clones of Ruby On Rails or something like that. We released a framework that “truly” takes advantage of what PHP is about, http://phponpie.com as open source. And in the two years since then, we have enhanced it a lot as our framework Q. You will hear about it soon.

Disclaimer: PHP, while useful, still suffers from the same problems that most imperative programming languages for web design do. The number of requests that it can handle at the same time is limited to the number of preforked processes. The worst part is when those processes have to wait on I/O. That’s why evented is the future, and why Node.js rocks.


Want to muscle PHP out of the “cheap and easy” niche?

Make sure your stuff works on cheap shared cPanel-driven web hosts!


PHP is like democracy. It’s not perfect, it might not even be great, but it’s the best we’ve come up with so far.


Analogy: “I’m so sick of people speaking English. It’s a clumsy language, a mutt of all others, and there are better alternatives that are more elegant and easier to use. I wish we all could write poetry in a better language.”

Who cares? People speak English as do people write PHP. It’s pretty easy to create a great platform with it, and explaining its inner-workings is cocktail fodder. Performance is acceptable, PECL is great, the documentation is par, and the community is vast.

So, the problem here is basically a disdain for the positions of curly braces and underscores? There are too many regex functions? Your $, >, or ; keys are broken? Zend’s ORM isn’t Railsy enough?

If you are fed up with it, then write more JavaScript. Everything behind the client is fast becoming glue for databases and filesystems anyway.


I reckon Jeff’s talking about this! http://golang.org/doc/


I have recently started working on a service oriented single page webapp, I don’t have much to back me up but I prefer to use Java with any of the available frameworks as my service layer and with a front-end which is built solely using HTML5, CSS3 and JavaScript. You can brag about Ajax security concerns, SEO and cross-browser compatibility all you want, but nothing will change the future. At least it is my belief about which direction web is moving towards.


I think some critics of PHP are missing the point. If the purpose of a software development environment is to ease the creation of software that solves peoples problems then PHP is a solid environment. Perfect no. Solid yes.

In effect the marketplace has spoken.

This is similar to the discussion technology analysts made when the iPhone was first released. Many of them promptly declared the iPhone, and then the iPad, dead on arrival. The problem was that the marketplace and the analysts were defining different criteria for “good”. Analysts were looking at features while users were interested in solving day to day communications problems.

Personally I still think that Pascal is one of the better languages I have used to create programs but when I needed to select a programming language for a business I was building I chose PHP, not because of its syntax, or structure, or support for objects, or computational performance, or (lack of ) support of multi-threaded code, but because as an environment – which includes the number of programmers that know how to use it – it was the best choice at the time (2005).

When evaluating technology we need to define the criteria of evaluation and ensure we are focused on the correct audience.


Another follow up on this:

PHP is easy. That means you will have many people making use of it. Non-coders and coders alike. It is easy for non-engineers and non-CS majors to grasp and start using.

Another thing going for it: Wordpress.

Tonnes of themes, plugins, etc. Wordpress is easy. Widely used. VERY functional.

I’ve been looking for a way to move way from Wordpress and PHP to say Python. No go. Nothing approaches the ease of use and feature sets. Sure, I can roll my own. Start with Django or go lower level with Twisted. But then it becomes a support nightmare for long term maintenance of themes, plugins, core code, etc.

PHP has flaws. But then again, every programming language has flaws. And in many cases, the flaws depend on who you ask, the usage case, etc.

But in terms of survivability of a language, PHP rocks where it counts. IE, widespread usage, plenty of documentation, an AWESOME online web search at php.net, and without much technical knowledge you can make use of the language. Language survivability isn’t the same as language elegance.

In that context, a cockroach, rat, cats, etc. might be a better image to represent what PHP is: a hardy language that refuses to go away.


I’m not exactly sure what there is in this article that so many people seem to be agreeing with. He does’t like PHP, OK that’s one thing. What else? Any critique of the language? Does he support his position at all? No, he just reiterates in different forms that he doesn’t like PHP. Somehow it’s like a hammer without the hammer, or a screwdriver without the handle, and we’re left to just assume that’s true. But, how, exactly? Are we supposed to just take the authors word for it?

Perhaps it might make sense to propose a viable alternative? Or give examples of things PHP does poorly and how those could be done better?

I had a job writing websites in PHP 10-12 years ago (the php3-4 era) and didn’t like it then. But it got the job done. What I dislike even more though are boldy stated assertions lacking in supporting arguments.


Mike E, the original article has more specific points http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/


I started off with Javascript, then tried PERL… but that didn’t work out well. So I tried C… and C++… but I wasn’t getting anywhere fast enough. So back to PERL I went… and that continued the disaster. Finally I switched to a cheaper webhost & they had PHP. Suddenly, I was able to get things done in PHP, and done quickly. That saved my butt in '99. About a year later, I tried getting into PERL again… but it was too much of a hassle. Same with Python. I got a little ways with C, but realized fast that it would take a long time before I’d be good enough to replace my PHP code with C. So, why bother?

Eventually… years later… I dove into Python and started taking the time for it. I’m now writing more Python than PHP, but my point is… none of these other programming languages are so well suited to the web as PHP. With PHP, you can just program and get stuff done… barely any need to mess around with things like permissions or setting up things on the server in any way. If these other languages started making it as easy to get started as PHP does – I think PHP would fade away. Until then, it’s easiest for newbies to start life on PHP.


What if you just put the bottle in the old shoe ? What kind of tool would you cast this way ? Here’s the answer with this awesome conversion table, and I challenge you not to laugh :



Where do I sign for this proyect of Anti PHP Movement (I know that sounds quite radical let me rephrase)

Where do I sign for the Movement of the PHP Alternative project?


How about this for not eating your own dog food?


The real question is this: Are you programming a language or are you programming a solution?

Having been a classically train (CS) programmer with years of experience in C/C++/Motif and Visual C++, PHP is a pure joy. I don’t have to futz around for hours just get a damn app to compile. I write, I test, I deploy. Done.

Maybe it’s that real programmers WANT to design garbage collectors and really grasp why you shouldn’t pass a CHAR* to STRING to a WCHAR_T…

Not me. I want to do this: “print($mydata);” and have it just f’en work.



WordPress in Python. That’s all it takes.