Since the dawn of computer science as a discipline, intellectual war has raged around many issues. Of these issues, the three most polarising, most able to rouse the most mild-mannered geek to unthinkable acts of violent rage (or at least a strongly worded Usenet post) are “Choice of programming language”, “Choice of text editor in which to author this language”, and “Choice of tabs or spaces with which to indent this language in that editor”.

The last two are now moot to all right-thinking people (Vim and spaces, respectively), but on the first point, we seem incapable of respectfully reaching the conclusion that the ‘right’ language for a job is always the one best suited to that job which one understands best.

It’s in our nature to want to square languages off against each other in the digital equivalent of savannah mating rituals to determine which is the Alpha of the pack, gets its pick of the most beautiful software engineers and gets to pass its genes on to the next generation of languages. Unfortunately, no such hierarchy exists, nor will it ever. There’s only ‘the right tool for the job’, and before we start the job, we should do the work of researching what tools look like a good fit.

The second factor which should influence any conscientious engineer’s decision is their familiarity (or assumed familiarity) with those tools which appear to fit well.

For example, a task may seem to lend itself to a paralellised solution, which in turn implies that the ‘best’ language for the task may be a functional language. With many strong contenders to choose from, a programmer with JVM experience may be inclined to attempt Scala, whilst a programmer with a a formal, mathematical training may be swayed towards Haskell[1].

Learning is cool

The preceding paragraphs have been a scenic route by which to arrive at the TL;DR point of this entire post: the most important skills in any discipline are research and a commitment to lifelong learning.

If you’re programming for anything other than a hobby and you’re using one ‘workhorse’ language for every task because you’re comfortable with it, and it feels like it fits you like your favourite, battered pair of Chuck Taylors, you’re probably making a mess of things.

Even if your dalliance with Haskell doesn’t lead to you using it for your next project, it will educate you and improve the code you write in your language-de-jour.

Many programmers do understand this, however some communities seem more siloed than others. Java has a bad reputation for this, but I don’t have the experience or knowledge of Java to offer a meaningful commentary. I do, however have years of commercial experience with PHP which lead me to well up with white-hot-apoplectic rage every time I read a defensive, Stockholm Syndrome-infused screed from a member of that community insisting that PHP is ‘good enough’ and ‘getting better’.

The latest such post to catch my eye was posted in .net magazine by an knowledgable and respected member of the PHP community, Lorna Mitchell. I’m going to offer a quick (ish) rebuttal, and then explain why the “average is OK” attitude and antipathy towards research and learning which regularly come out of the PHP community make me an angry man:

Allow me to retort…

PHP doesn’t have one ‘Rails’, it has thousands of frameworks, which means you can pick the right tool for the job.

This is irrelevant. Ruby has many frameworks. Most languages have many frameworks. PHP is only at least as good as any other language by having many frameworks. What’s important is the differences in style between languages and how they influence the development and style of these frameworks.

PHP5 has a true object model

This is irrelevant. Many languages have a ‘true’ object model. What’s interesting is how and why they differ, and the consequences this has.

if you’re a software engineer, you can work with PHP without tearing your hair out.

Is this the best praise we can muster?

at the conferences and on the PHP news sites, there’s a lot of content about improving quality of tools and process [...]

PHP projects are looking more and more like a serious software project should.

Again, this is faint praise. Without sarcasm, I’m glad that PHP is trying to come of age, but being almost-but-not-quite-there with best practices does not debunk PHP’s deserved ‘cowboy coder’ reputation.

Because of its open nature, almost all of the best resources are freely available.

Also irrelevant in a comparison. There are many open source programming languages, and strong open communities around most popular closed languages.

There are some fantastic open source products built with PHP that will save you time and headaches, and yes, there are plenty of truly awful ones as well.

Again, completely irrelevant. Every language has good and bad projects. You won’t learn if you stick to the ones in a language you’re comfortable with.

Hate the sin, love the sinner

Criticisms of PHP, both founded and unfounded abound on the web. Google will find you some, but beware red herrings like ‘poor security’ (irrelevant, every language/project will make a mess of it at some point[2]). It’s my subjective opinion that PHP is less fun, less elegant and less productive than any other mainstream language, but that’s not the point.

The point is that when prominent individuals in the PHP community ‘debunk’ PHP’s bad reputation by insisting it is ‘average’ compared to anything else, they do no-one any favours. By encouraging the community which looks up to them for leadership and advice to double down on PHP and not explore solutions from elsewhere, they harm the development of individuals in that community. In turn, this harms PHP itself, as it shuts off an inward flow of ideas and practices learned elsewhere.

If I were feeling cynical, I’d argue that this comes from a fear of a diaspora of developers to ‘better’ languages once they research these languages and find them more fun and productive, but I genuinely don’t believe that fear exists. I believe Lorna has conviction that PHP is a great language, and the best way to help it flourish is to attempt to defend i.

Again, I subjectively disagree that PHP is great. I think PHP is an ugly mess, but I’m willing to hear arguments to the contrary. However, the second point is objectively wrong, and stunts the development of individuals and the community. It’s time to stop this introspection. If the language is genuinely good, it has nothing to lose (because there’ll be no diaspora) and everything to gain from its advocates mingling with other tribes and learning from them. Let’s have more of that.

[1] Anyone taking this as a comprehensive factual summary of the pros and cons of these languages rather than an illustrative example is an idiot.

[2] Although this was pretty bad.

About these ads