3 Worst Programming Languages to Avoid Like the Plague

2. PHP

This is where things may get contentious. PHP is a server-side language designed for web development. Originally released in 1997, PHP quickly took over the web. You’d be hard pushed to find any large web entity that doesn’t use PHP. PHP introduced the concept of Dynamic Websites, allowing users to query databases in real time rather than loading static pages on each interaction.

A recent Stack Overflow survey shows PHP as the ninth most popular language, and there is still a considerable demand for PHP developers. So far so good. Widely used, in demand, long-standing, what isn’t there to like?

Well, depending on who you ask, quite a lot!

Inconsistency

PHP wasn’t meant to be a language and grew piece by piece rather than with a general structure. This makes learning PHP a frustrating experience.

An example of this provided by aptly named phpsadness is PHP’s get function:

gettype()
get_class()

These little inconsistencies in the naming of in-built functions are part of a much larger problem. Small differences in syntax and semantics make PHP difficult to learn when coming from another language.

In an age of programming language polyglots, these issues might not be a big deal to you, but it is enough to make some developers run for the hills.

One more thing before we move away from these types of inconsistencies. In PHP, function and class names are not case sensitive, but variables are.

Wait, what?

The Ternary Operator

Whether it is a product of PHP’s ad-hoc structure or the mad whim of one of its creators, the ternary operator in PHP is baffling. Consider this:
$a = 11;
echo (
$a == 10 ? ‘ten’ :
$a == 11 ? ‘eleven’ :
$a == 12 ? ‘twelve’ :
$a == 13 ? ‘thirteen’ : ‘something else’);

echo “\n”;
//this code prints ‘thirteen’ to the console

As you can see in the above example, PHP does strange things with ternary operators. In almost all other languages you would expect this code to output eleven. PHP disagrees.

This strange behavior comes from PHP using a left associative ternary operator. This somewhat mind-bending behavior is utterly unintuitive to many programmers, and even after reading a detailed explanation of how it works, it’s still baffling.

PHP is still used widely, and many people claim it has improved hugely over its 20-year tenure.

If you want to create your own WordPress plugins, then it’s certainly worth learning. There are great resources out there to get you started learning PHP, and its popularity means you will likely land a development job once you have.

The real question is: with so many other languages out there, and the rise of other frameworks like node.js and Ruby on Rails, do you really want to?

Prev2 of 5Next

Leave a Reply

Your email address will not be published. Required fields are marked *