I am strangely fascinated with programming languages. I don’t really know why, but this seems to be a common state of affairs amongst computer scientists. Why else would there be so many of them? Whilst it’s hard to pin down exactly how many programming languages there are, a figure of around 10,000 is not unreasonable, which is somewhat greater than the number of spoken languages. Granted, many of these are extinct, or only used by one person in a basement, but that still leaves 1000s of programming languages in current use, and perhaps 100s in reasonably widespread use.
Why are there so many? Well, there are various reasons for this. One is that there are lots of use cases for languages. Some of these favour languages that run really fast, some favour languages that scale really well, some focus more on minimising resource usage, and others are more concerned with readability or elegance than performance. For instance, developing large applications like MS Office requires a language that scales really well, allowing its developers to manage and integrate large amounts of code written by many people without the whole thing deteriorating into a pile of spaghetti. Developing applications that will run on small embedded systems requires a language that can make the most of a slow processor and a small amount of memory. By comparison, those doing data science often care more about speed of development and minimising the amount of code they have to write.
Regardless of why there are so many of them, this glut of languages makes it hard for anyone choosing a language to learn. If you take a look at one of the programming language rankings1, you’ll typically see that around 20 or so languages are popular at any one time. Some of these have been around for decades; for example, C, C++, C#, Java, Javascript and Python. Others are up and coming languages; currently these include Swift, Go, Kotlin, Dart and Rust, to name but a few.
The one glimmer of light for anyone looking to choose a language is that, although there are a lot of languages in common use, many of them are closely related. To give an idea of this, consider the following diagram, on which I’ve tried to show the relationships between many of the languages which are currently considered popular (plus a few older ones to show where they came from).
Most languages in current use either inherit (solid line) or borrow heavily (broken line) from the syntax of the so-called Algol line2, which means that most people can comprehend code to some extent that’s written in another language. In the diagram, the Algol line is the line of descent that starts at Algol and moves down towards Java and C#. These languages were designed for writing large dependable software systems — hence the term “industrial-strength” that’s sometimes applied to them. They were hugely popular from the 1960s onwards, and can be found in the vast majority of legacy software systems. This means that languages like C++, Java and C# are very unlikely to die out any time soon, and are still a good choice for new learners. They also continue to be actively developed, integrating ideas from newer languages.
Another language that has stood the test of time is Python. Although people often think of this as a relatively new language, it was first released in the early 90s. For many years, it was a niche language, only finding popularity with the onset of the AI boom. Python serves a very different use case to the Algol-line languages. It’s not a great choice for writing large software systems, and code written in Python runs very slowly3, but it is a great scripting language that enables developers to put together functioning software very quickly. For this reason, it continues to be the default choice in data science and machine learning4.
However, if I were to learn a new general-purpose language today, I’d probably focus on one in the orange-and-blue bundle towards the bottom of the diagram. These languages blend ideas from both the industrial-strength languages and the scripting languages, and manage to maintain the speed and scalability of languages like C++ whilst having the friendlier and less-verbose syntax of languages like Python. Kotlin is a good choice if you’re an Android developer or from a Java background, Dart is great at cross-platform development, Swift is the natural choice for Apple developers, and both Go and Dart are backed by Google.
Another language well worth considering is Rust. Intended to be a replacement for C and C++, it’s popular with its users, and is often described as being elegant. Rather than borrowing Python-like idioms, it’s instead influenced by another group of languages, the functional programming languages. These languages never quite made the mainstream, but they have a lot going for them. But that’s a story for another day.
As a final thought, there’s always a certain amount of gambling when choosing a language to learn. Many languages have appeared, but few have gained real uptake. The ones mentioned above seem to be beating the odds in this respect, but you never really know which of them will make it in the long run. Take Pascal as an example — it went head to head against C and C++ in the 1990s, at which time it was the standard language for Apple development and the most popular teaching language within universities, but 30 years later it’s nowhere to be seen.
I like those provided by RedMonk (https://redmonk.com), since it provides a lot more information than those which try to create a single ranking.
Named after Algol, a language that is no longer in use. Interestingly, its progenitor, Fortran, remains in use, mainly in physics departments and partly because it was used to write software for all the big telescopes and such like that were built in the 1960s.
This is because it is an interpreted language. Most of the AI and data science libraries that Python uses are written in compiled languages such as C++.
Though, if this is your thing, you might also keep an eye on Julia. Unlike Python, this is a compiled language, so it runs at a sensible speed.
I know Fortran predates Algol but I wouldn't have said that the latter developed from the former. Also, no Cobol? I look forward to further installments ... keep up the good work.