Those horrible 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, 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. 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.

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. So which language should you learn for web development?

It's a no brainer. But if you want to work on data analysis 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 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 started out 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.

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 applications.

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.