Today we are covering a topic that matters a lot and keeps coming up in conversations with friends and on social media. "Programming" has been around for a long time, yet it still draws more and more people and now reaches a much wider range of industries. I have even seen the claim that writing programs is now a basic craft of the modern person. I can't fully agree, but there is no denying that plenty of people, lured by the broad prospects of the IT industry, want to retrain as developers. And as in many professions, a large share of people still enter this world young, out of passion, sometimes carried away by the idea of making video games (the undersigned is one of them). Others take it up as a hobby, hoping to write scripts or tools that make their "regular" work easier.

For all these reasons, you often hear the question: which programming language should I start with? It is usually asked in the hope that there is one universal answer that opens the gates to endless possibilities. Is there?

Well, let's find out.

Why do people want to learn programming?

I already answered this question partly in the introduction, but it is worth going deeper. A dozen or so years ago, the most common reason to learn programming was simply curiosity and an interest in computers among young people. For them (especially at school age) it is easier to soak up new things and get hooked on a subject. As a result, many of them start using their skills commercially early on, often with excellent results, while also realizing that this field is full of people just like them.

In recent years there are also more and more career changers who see the IT market as a new place for their professional path. That doesn't mean they approach programming without emotion, since these stories vary a lot. Sometimes it is a hidden dream from youth to do this seriously, which got in the way of everyday life. Either way, the difference between these people and the "youngsters" described earlier is that they are mature adults who know well what they want and where they see their future. They won't jump on every new thing out of sheer passion, but they choose their path as a beginner carefully. As long as they know how.

It is also worth mentioning people who want to learn programming out of curiosity or to support their work, for example at university. You could say they combine the first group with the second: in their free time they gradually learn new things, try and tinker, until they reach a level that lets them write a specific application. It is like DIY, which fills time and calms you down (yeah, as if only programming could calm anyone down...) and still produces something useful.

Of course, there are other reasons too. Everyone has their own motives, motivation and needs. There is no point lumping everybody into one bucket, or even a few. That is one of the reasons it is so hard to give universal advice on how to start programming.

Does the programming language matter?

Source: olia danilevich (https://www.pexels.com/pl-pl/zdjecie/mezczyzna-osoba-biurko-laptop-4974915/)

This question may sound funny, but you sometimes hear that "the programming language is irrelevant, what counts is the ability to program and think like a programmer." This refers to the fact that writing code is really about planning, logical reasoning and using techniques shared by many languages, and only last about knowing the specific rules of a given language. The idea is that a good programmer can handle any (or most) languages and quickly pick up the details of a new technology. To a large extent that is true, but it applies to experienced professionals. What about beginners?

My answer is: for them, the choice of language definitely matters. If we treated them like experienced coders, they would have to learn the theory of writing programs, the basic concepts and paradigms, all detached from writing any actual program (or working with pseudocode scribbled on a sheet of paper). Yes, they should learn all of that, but in due time and while learning a given language and building simple applications. Otherwise a beginner will quickly get discouraged, and enjoying what you are learning is extremely important. Compare it to learning a foreign language where you first study the whole grammar, all the tenses and constructions, but without any vocabulary. You would soon grow to hate the idea of learning that language. It is better to combine it with vocabulary, or even to start with a Duolingo-style approach, where you pick up grammar rules along the way.

The choice of language also matters because languages differ in purpose and popularity. Without a suggestion from an experienced colleague, a beginner may by accident pick not only a rarely used technology for which they won't find much advice online (say, Pascal, because "I heard something about it and even found a book from 1999 on the shelf"), but also one that has nothing to do with the type of application they aspire to build.

That is another reason a good choice at the start can be the beginning of a pleasant adventure rather than a grind of "I don't like this, but I know I have to." At the outset, a beginner should think it through and decide what type of application they want to try (web, mobile, games and so on, we will come back to this) and whether they want to enter the commercial market, and if so, in what form: with their own business, at a small or medium-sized software house, or at a corporation. Of course, you don't need to know the answers to these questions from day one. Still, just as with software, well-defined requirements raise the odds of a successful road to success.

Which programming language should you start with?

We finally get to the answer. As I mentioned, the choice depends on many factors, but there is always a group of people who either can't define their expectations yet or simply need a single name as a push to keep looking for learning materials. So I will start by naming the language I think you can recommend blindly to a beginner, without knowing the context. That language is:

JavaScript

The main argument is that over the years it has become a general-purpose language. Of course, it is best known for web applications (from simple websites to quite complex portals), but you can just as well use it to write mobile apps (which we do ourselves, using Apache Cordova and Ionic) and desktop apps (Electron). Thanks to Node.js and various frameworks, JS can be the foundation not only of the frontend but also of the backend. That is why there is demand on the market for specialists in this technology (although frontend clearly dominates), so it won't be a wasted choice if you plan a career change.

It is also a very approachable language in terms of difficulty, even though there are legends about its strange behavior in certain situations (and they are not without merit). It has a syntax similar to most widely used programming languages, so learning another technology later won't be hampered by getting used to a different way of writing code. (This is why I don't recommend Python as a first language, although it is also fine for starting out.) On top of that, writing JS doesn't require installing specialized and hard-to-understand tools. For basic learning, a plain text editor is enough (though I recommend Visual Studio Code, or Notepad++), plus XAMPP to run a web page that contains a script written in JavaScript. Node.js is a bit different (and so is TypeScript, which lets you write in Angular or in the React framework), but even that isn't particularly complicated.

It is certainly not a perfect language, but there is no such thing, and JavaScript ticks many boxes that matter to a beginner. It is a technology that is very widely used, not hard to understand, forgiving of many mistakes, versatile and long established in the IT industry. Of course, it needs HTML5 and CSS alongside, but this text is strictly about programming languages, while HTML, which is everywhere on the web and relatively simple, is a markup language. Scientists can also find components in JS that they will need for their work (for example machine learning or charts), although Python or other, more specialized environments will serve them better.

So now we know which language could be recommended as a "shot in the dark." But depending on a person's preferences and development plans, it is worth knowing the other options, which can be a better or worse choice in different situations. Let's go through them.

Source: Sharon McCutcheon (https://www.pexels.com/pl-pl/zdjecie/fotografia-z-wykorzystaniem-obiektywu-tilt-shift-pieciu-roznych-warzyw-1196516/)

If your focus is web applications, the range of languages is very wide: PHP, disliked by many, Java (or C#) used in corporations, and Python. This is also where JavaScript shines most, especially on the frontend. Here you should clarify whether the person is more interested in the part visible in the browser and the interface (then focus on JS, HTML5 and CSS) or in the backend, meaning the logic of the application on the server and working with data. PHP has a bad reputation (somewhat exaggerated, and we will come back to that in the future), but it works especially well for smaller sites (which doesn't mean it can't power huge applications, and we are proof of that). Java, in turn, is closely tied to the corporate world, and I would recommend it only if a beginner is aiming for a job in that sector as fast as possible.

For mobile applications you need to be more specific and pick an operating system. The market has Android specialists and iOS specialists, and it is rather hard to combine the two because of the different technologies involved. For the system backed by Google, you should definitely look at Java and/or Kotlin, though it is worth remembering that these two are close to each other. People interested in Apple devices should look at Swift (Objective-C used to exist, but Swift has long been the official technology for iOS). Of course, here too you can still write apps in JavaScript using solutions like Apache Cordova or Ionic. We shouldn't forget Flutter either, but I wouldn't recommend it to beginners, given how specific it is and its relatively small popularity.

In many cases the direct motivator is the desire to write video games, and for a long time there was essentially one choice: you had to learn C++, the technology offering the best compromise between convenience and the performance that matters so much in this segment. Over the years the range of possible technologies has gradually widened, but C++ is still king in this category. It is worth noting, though, that for games it may be better to start by choosing not a language but an engine. We will come back to this later in the text.

People who want to learn programming for academic work or for machine learning should look at Python. It is a general-purpose language that many consider very easy to learn thanks to its friendly syntax. That can be both an advantage and a drawback, though, because moving from Python to another language that uses curly braces can be painful. On the other hand, Python stands out with a huge number of libraries, including scientific ones. It is not the only choice: Java is just as interesting, and even Node.js (that is, JavaScript), mentioned many times already, for example with the Brain.js or Tensorflow.js libraries. Take a look at this article.

Finally, let's look at the options for people inclined to program various hardware or systems. Unfortunately, the choice here is driven more by the specific environment a beginner is getting into, but it is probably safe to point to C, C++ and Python. The last one is by far the most convenient of the three and works well with the popular Raspberry Pi. For lower-level uses, it is worth getting to know the other two languages. There are also devices with libraries available for Java (printers, for example), which only shows how diverse this field is.

Of course, like everything in IT, the available and considered technologies change, as do the uses and expectations for applications. That is why it is worth following rankings of the most popular technologies of the year, such as those from Stack Overflow or GitHub. But that's not all: you can find a broader description in education-related rankings too, such as this university website or this one connected with Berkeley. You also need to know what to look at and not give in to every ranking: being first in a ranking of the most popular languages is not a reason to learn that "dialect," because it depends on too many factors. It is always worth asking someone more experienced than you, who will likely point you to materials suited to your level. That is, by the way, advice for programmers who are already familiar with the subject as well: rushing at every new technology is not always the wisest move.

Is it worth starting with a framework?

Frameworks are ready-made modules written in a given programming language that make it easier to build a particular type of application, so a programmer can focus more on the business logic than on writing the foundations of, say, a website. Since it makes things easier, and job ads name specific frameworks, maybe it is worth starting not with the language itself but with a framework, and learning both at once? The answer is not that obvious.

In some cases it really is the right approach. I mean video games in particular, where developers build productions with ready-made game or graphics engines and put together applications from building blocks, seasoning them with code. It is a natural solution there, since in the end you can create a program without knowing how to code, or while doing it in a very limited way.

In general, though, focusing on a single framework can be problematic, because a beginner will have trouble telling what is part of the language and what belongs to the tool. I have sometimes met developers who declared some experience with React, then landed on a project with Angular and... behaved like children lost in the fog. Both frameworks use one language (JavaScript, or more precisely TypeScript), but for someone who had learned React rather than JS, it wasn't clear which "behaviors" carry over to the sister technology. Frameworks also often require some general programming knowledge to use the provided "blocks" properly, and a beginner, for obvious reasons, doesn't have that orientation.

That is why I am not a fan of starting with a specific framework. I would recommend getting familiar with the language and its syntax first and bringing in your chosen framework a bit later. Unless you treat learning to program as typical training for a particular job with specific requirements, or you have a clear idea for an application. Then the choice gets simpler, though it is worth remembering to learn the difference between syntax specific to a framework and syntax general to the language.

CMSs such as WordPress or Drupal are a separate matter. They are also tools for building websites with no (or minimal) programming knowledge. There is demand for such specialists on the market too, although CMSs are often tied to simple, almost mass-produced sites, and many people will say it isn't "real" programming.

How to learn programming?

Thanks to the Internet, a would-be programmer has practically unlimited options for the path they want to follow. That is also a curse, though: there are so many options that it is hard to choose the right one.

The obvious path is tutorials available online, which let you start and get to know the basics of a language or technology. For JavaScript you could name JavaScript.info, Tutorials Point, and even something many experts would advise against because of its many errors and outdated content, W3Schools. There really is a lot of material to choose from.

There are other paths too: video tutorials and books (though they are not always a good choice). This is also the place to mention paid courses and bootcamps, where many people begin their path to commercial programming. It is definitely an option to consider, but note that it is rather expensive. In my opinion, it is worth first trying programming on your own by working through a chosen tutorial and seeing whether this is really something you want to deepen your knowledge of and tie your future to. Then a bootcamp is definitely something to consider, although following a good tutorial may turn out to be enough.

And if you are looking at the much bigger picture and want to know the whole (sample) path to becoming a specialist in a given area of programming, I recommend the roadmaps collected in this repository.

Summary

I hope I managed to answer, in this text, the question of which programming language a beginner should choose. It is not an easy choice, and it is not simple to judge how much that choice matters either. Programming is constant learning, and at some point you realize that you switch between different technologies fairly freely. It is also a good career path, but remember that to a large extent it is also fun and a form of modern DIY. It is no accident that many programmers (especially the enthusiasts) learn new things at home after work and program their own applications, achieving very good results and fulfilling themselves intellectually along the way.

I wish good luck to everyone who wants to learn programming. I keep my fingers crossed for your determination and drive for self-improvement :)

Best regards and thank you, Jakub Rojek.