Those awful articles about "the best" / "most popular" programming languages"

Sick of low quality clickbait articles about "the best" and "the most popular" programming languages? Even reputable sites play this game. I suppose they do it because "what language should I learn" is a question that every aspiring programmer has to ask. There's a lot of traffic in it, so they keep churning them out.

Nearly all of these articles are bad, because they are based on irrelevant garbage metrics such as trends in keyword searches, recent Github activity, average salaries, "popularity" or similar. They also suffer from horrible sample bias, failing to acknowledge that the programmers that responded to their survey are a subset rather than a representative sample (are web developers really going to vote for C?). For example, if a lot of people search for "Javascript" clickbait articles often extrapolate this into "popular" and/or "the best", and slap it into a top 10 (!) list of languages you should learn.

I can only think that many of these articles are written by people that have no absolutely no development experience, because they are full of ignorant conclusions such as Javascript being "undoubtedly the dominant language of the web" (no, if anything that's PHP) or "Javascript is a general purpose programming language" (this is like calling my bicycle a general purpose vehicle) or horrific advice like "Javascript is the number one language so that's the one you should learn" (facepalm).

These articles are rubbish and meaningless.

There is no universal "best language"

Different languages have different applications and the most suitable language for an aspiring programmer to learn depends on what you want to do. For example, if you want to be a web developer then you need to learn the fundamentals of HTML and CSS, a primary web scripting language such as PHP and the basics of Javascript, because these are the languages that webservers and browsers understand.

Conversely, if you want to work on microcontrollers or do system programming then fast, efficient (read "compiled") languages such as C and C++ are relevant and PHP is not. Android? You need Java or Kotlin, because Android is Java/Kotlin. Rip text files apartĀ  for analysis? You'd be mad not to choose Python. Desktop applications? Now here you have a lot of choice, you could use nearly anything such as C, C++, Golang, Java or Python or a host of others, but PHP or Javascript are not going to be appropriate (read "sane") choices in this environment. Yes, you can write desktop apps in Javascript but with certain rare exceptions, they tend to suck, performance-wise (and if they don't suck performance-wise, then they certainly suck security-wise, Electron I'm looking at you).

Another flaw of these clickbait articles is that they rarely consider the level of real world support for languages. You can go learn the latest and greatest language such as Rust, but will you be able to find contributors for your bleeding edge open source project? How many employers will be looking for people with such skills to join their team?

An example: According to many articles Python is great and people really like using it, and actually this seems to be mostly true. And there are a couple of solid, well-known Python-based web development frameworks (Django, Flask). But as far as web development goes only about 1% of websites are actually using Python, whereas the hopelessly unfashionable PHP accounted for around 80% of all websites in 2018 and is available on every mainstream web hosting account. So which language should you learn for web development? It's a no brainer.

But if you want to work on data analysis or manipulate text files, then your choice will be different.

Javascript (JS) deserves a special mention here since it seems to get more than it's fair share of attention, and the advocacy has entered the realm of self-perpetuating flat-out propaganda. Scrutinise a "JS numbah one" article and you'll usually find the author has a background in front end development (ie. UI design, not engineering). They advocate a "JS everywhere paradigm" because...that's what they know. Inevitably, they began programming by tinkering with JS on the front end and with the rise of JS frameworks they were able to start programming in it, including on the back end. Since they didn't need to learn a new language for the backend, they didn't bother trying anything else, and quite possibly, they just have no idea how bad it is for that, or how much better the alternatives are. Personal convenience does not necessarily make something a sane choice.

If anyone that tells you "Javascript is the only language you need to learn", ignore them. Mindless fanbois drive me crazy. I like and use PHP, but I also criticise it.

So how to pick your first programming language?

Decide what type of development work you want to do, then pick a mainstream, widely supported language that is suitable for that task. And if you're hoping to get a job then absolutely stick to boring industry standard languages, by which I mean the ones that people actually use to build the kind of things that you want to build.

If you eventually end up working across more than one domain of programming you will probably need to learn an additional language or two. It's good experience and will broaden your horizons. Don't be tempted to try and shoe horn your favourite (only) language into a role it is not suited for. That's how you end up with horrors like serverside Javascript frameworks.

Sane recommendations

So finally, here are a few foundation language recommendations for different tasks. Spoiler alert: They aren't very exciting, but they will serve you well:

  • Learning programming concepts (first language): Python.
  • Embedded systems (microcontrollers and resource limited systems): C.
  • Server-side scripting jobs (automation, maintenance, analysis of text and data files): Python.
  • Data analysis and manipulation of text files: Python.
  • Web application development (back end): HTML, CSS, PHP and basic Javascript (plain JS basics, then jQuery).
  • Web design / user interface (front end): HTML, CSS and Javascript (plain JS basics, then jQuery, and only then frameworks).
  • Mobile development: Java/Kotlin (Android), or Swift (iOS).
  • Large scale enterprise software: Java.
  • Big fat complicated industrial standard language that can do nearly anything, but not easily or safely: C++

If you are just starting out and want to learn how to programme and don't have a clear objective yet, I'd recommend Python as your starting point. It has the easiest syntax, plus with a few lessons you can actually start doing some meaningful work on those awful spreadsheets your colleages keep kludging together.

If you want to learn Javascript, *avoid* the cool new frameworks which will inevitably be obsolete by the time you have mastered them. You're better off learning the basics so that you can actually write simple JS yourself (a transferrable skill that will not expire), then study jQuery which is a widely used, stable and sane library that makes handling common tasks easy. Then go play with frameworks.

But wait! I hear you cry. "I want to be Avante Guarde and look to the future". Well ok. Golang is great as a general purpose language and seems to be gaining a lot of traction. It's kind of like a modern C with added memory safety features and native support for multithreading, strings and UTF-8. It's even good for web development, except that few web hosts support it yet. However, it's not suitable for embedded systems as small programmes in Golang still generate large binaries (relative to C), that just won't fit on a typical microcontroller.