You may find a lot of programmers agree with this article - along with others who staunchly defend their favorites - when we say that some of the worst programming languages today are PHP, C++, JavaScript, and Perl.
There can be no objective responses to questions of best and worst in programming languages. But we've tried to make our explanation as non-subjective as possible.
You may agree with us when we say a bad coding language can be popular, like C++, JavaScript and PHP. At the same time, there are good languages which programmers enjoy using too, like Python, Ruby, Java, C, and C#. Many of these are open-source, which may or may not suggest something to you.
Before you get indignant about our choices, you must also note what we mean by a bad programming language. We mean a language that is not consistent, that may be arbitrary, or one that is not easy to read, write, or understand. We are referring to the syntax of the language. A bad language is one that makes a programmer's job stressful and unpleasant, despite having been used for decades with a highly mature ecosystem and plenty of documentation and support.
Programming languages like Python and Ruby run slower than a compiled language like C++, but don't make our list because language performance is irrelevant with the hardware we have today. Nothing has stopped Python and Ruby from being widely used, because in the end it is not the code execution time, but the end-user experience that matters. In most applications, it doesn't matter that Ruby and Python are slow. In the cases where performance does matter, you can always glue code in a different language to Python or Ruby logic. However, developers enjoy writing code in Ruby and Python because the code looks elegant, and is easy to read, understand, and maintain.
So, why is it that the nightmarish syntax of C++ still has so many takers? Why do big console video games continue to be crafted in C++? And what is it that makes the four languages we abhor the worst? Let us take a look.
C++
C++ is a monster of a language that you cannot help but respect. It's the granddaddy of modern OOP languages, the favorite of Fortune 500 companies like Microsoft and Oracle, which wield big money for support.
But it has become too expert-friendly, in the words of creator Bjarne Stroustrup. He says the solution is not to dumb C++ down but to educate more experts and use a variety of coding languages. He has his opinions, but in mine, any language that is not developer-friendly is a bad egg. Though C++ is fast, it is unforgiving and flawed. It has excellent in-memory management and a vast collection of libraries, which make the language very powerful. But as with JavaScript, with great power comes great responsibility. It is easier to make common mistakes in C++, and harder to find people to maintain C++ code.
C++ is great for certain specific systems admin tasks, for writing device drivers and system kernels. It is a great general language, but as Stroustrup says, if you shoot yourself in the foot with C++, you take a huge chunk off.
Learning C++ will make you ripe for the programming job market. Browse C++ jobs on Freelancer and you’ll see that programmers who know the language are in great demand.
JavaScript
JavaScript is the language the web gets built on. You can't avoid it. And it has some elegant things going for it, such as functions, arrays, dynamic objects, loose typing, and expressive object literal notation. Some people would say that if used right, JavaScript can be very rewarding for browser scripting. But the bad parts often overpower the good.
To begin with, there's the misleading name - JS does not come from Java. They only share common ancestry in C and a few keywords. Then, a lack of native integers means that larger numbers get less precise. Bad input data will always somehow get you results. There is enough rant against JS to justify its inclusion on this list. The problem is, it is meshed deeply with the web and is here to stay.
PHP
Many things make PHP evil. A look at the alphabetical list of its gazillion functions will show you one. Some might say it's the foulest language of the lot.
There seems to be a lot of arbitrariness in PHP's syntax, and each function appears to use a different argument order and naming convention from others. Half the string functions use strfoo while the other half use str_foo, for some unearthly reason. It's as if someone created PHP using a random number generator. People call PHP the "duct tape" language. Developers use PHP for quick patch-ups, but it's not that great for serious programming.
One cannot deny that PHP has a vast ecosystem of frameworks on which some great websites have gotten built. It was also the first server side language that could get used for web development, so it's been around for a while. But there are other old languages like Ruby, C#, and Java with fantastic ecosystems too. Why would people choose PHP?
Perl
For a long time, Perl competed against Python, with some people leaving one for the other. I have never understood why people left Python for Perl, though the reverse always made sense.
There are many things that you may find wrong with Perl. Even though it is easy to use, it is also easy to tear your hair looking at Perl code that someone else has written. Perl is not easy to maintain. There's the line noise reputation everyone knows about. If you've ever tried to explain the difference between $array[$key] and $array -> [$key] you'll know what we mean by tearing your hair. Then there's context - that inexplicable source of hard-to-find bugs, though it also makes Perl a more expressive language. Passing parameters to functions is a struggle. There are a host of other problems one can point out with Perl, including the difference between array references and arrays.
Data structures, context, and a host of other features make Perl an expressive language, but at the cost of readability. Perl is not easy to learn. It is no wonder that Python wins out against Perl for many people, because Python is easy to learn and use.
We cannot ignore the fact that Perl gives the programmer the freedom to do almost anything they want, while Python recommends the one obvious way to do things. But if Perl comes with a code that is hard to read and maintain, it might take the pleasure out of coding for many developers. It makes Perl one of the worst programs in our book, more so for its potential.
We've only chosen some of the most popular languages for our list. There are a host of others that we advise you to stay away from if you can help it. TECO is one, in which almost all characters are operators. Objective C has confusing annotations and confusing syntax that you need getting used to, though named parameters help with the readability. MUMPS is another affliction with cryptic commands that anyone would avoid.
Feel free to disagree with any of our choices here, though we would prefer if you note our definition of a bad language before you jump in. What are the languages that have given you nightmares? Let us know in the comments below.