Which programming language should I learn?

Which programming language should I learn? Chapter 4

Even if you’re currently still at the beginning of your learning journey, you’re probably already wondering which programming language you should learn.

You might have heard of some of the popular languages, like Python, Java, JavaScript, or C++.

We still need to learn a few more things before we start programming, but we can look at some programming languages and see their area of usage. Unfortunately, we can’t dive too deep into each programming language, because it’s hard to explain them without being farther down our software journey.

Nevertheless, we can get a general idea!

There are different classifications of programming languages, but they usually fall into two categories: dynamically typed and statically typed.

Dynamically Typed

These are programming languages that allow a bit more freedom when you code. This is because they don’t require you to specify the type of value that you want to store in a variable beforehand.

Python is an example of this:

a_variable = 3
another_variable = "hello"
and_another_one = 5.6

I gave each variable a different type of value. I gave the first an integer, the second a string of characters, and the third a decimal.

The way these languages usually work is that, when you run your code, they check what value you gave each variable and “deduce” the type of the value.

Other than Python, other popular dynamically typed languages are JavaScript, Ruby and PHP.

Most programming languages are pretty versatile, meaning that you can do many things with them. You can write a script, build a web application, make a machine learning model, build a game, and much more. However, programming languages usually have an area where they’re most used. This is because they are particularly good at performing certain tasks, have many libraries and the community is big in that area.

Areas of Dynamically Typed Languages

Python is especially popular to write scripts that manipulate data. That includes scripts to automate data processing and manipulation, as well as scripts for machine learning and data science. We also use Python in building web application backends (what happens under the hood of web applications).

JavaScript is mostly used to build web applications. We use it to create dynamic web pages (as opposed to just text and images that you don’t interact with). We also use it to build web application backends.

Ruby, while visually quite different to Python, has a very similar niche to it. It’s popular for scripts, and also has a small set of (big) companies that use it to build web application backends. However, it’s much less popular than Python in machine learning and data science.

PHP is a language that tends to be associated with old web application backends. This is usually what we use it for. Don’t look down on it because it’s so old, since about 75% of all websites have a PHP backend.

Statically Typed

These languages require you to specify the type of value you give to each variable. Considering that you will have hundreds or thousands of variables in a software, defining the type of each variable will become cumbersome.

So, why would we want to use these languages?

What makes these languages very useful is that, because they know the type of every single variable before you run the code, they will be able to catch many bugs automatically. Believe me, there is always some bug in your program related to the types you’ve assigned to your variables.

How do they find those bugs automatically? It happens when the compiler compiles the code from what you’ve written to something the computer understands. Don’t worry if this doesn’t make complete sense for now, because we’ll discuss it in the next chapter!

C++ is an example of a statically typed language:

int aVariable = 3;
string anotherVariable = "hello";
float andAnotherOne = 5.6;

Variables now have a type before their name. This will ensure that you will never be allowed to use a variable of an incorrect type to do something that expects another type.

For example, if we try to add aVariable with anotherVariable, the compiler will give us an error because you’re trying to add 3 with "hello", but the computer doesn’t know how to add a number with a string of characters.

The most popular statically typed languages are C, C++, Java and C#.

Areas of Statically Typed Languages

C is used to build operating systems like Windows, macOS, Linux, Android, iOS and so on. It is probably the hardest language to learn, out of the ones I mentioned.

C++ is used to build applications for different operating systems. It’s extremely versatile, with applications in the areas of video games, business, medical, machine learning, simulation, aerospace and much more. It’s usually very good for optimizing a software to run very efficiently on a particular computer.

Java is popular to build applications on different operating systems (and especially on Android). Java developers build these applications for a wide range of areas, but Java is more popular for business applications.

C# is the programming language for Microsoft products. It’s somewhat similar to C++, but we mainly use it to build applications on Windows. It is also very popular for building video games.

Which type of language should I learn?

You will learn multiple languages naturally throughout your career, but it’s important to have knowledge of programming languages in different paradigms (or ways of programming).

This is why I recommend learning at least one dynamically typed and one statically typed language. I’m not saying to do this at the same time, but throughout your early career.

One thing that you will notice if you choose to learn a dynamically typed language first is that statically typed languages are “hard”.

The opposite applies if you choose to learn a statically typed language first. You will also realize how much more you understand what is going on “under the hood” of what you program. Usually, if you pursue a university degree, you will learn a statically typed language first (for me, it was Java).

Which programming language should I learn?

If you’re looking to make web applications, learn JavaScript.

For anything data related, learn Python.

If you’re interested big companies and big software, learn Java (look at Scala too).

For scientific applications, learn C++.

If Android apps are your thing, learn Java (look at Kotlin too).

For video games, learn C# or C++.

These are general guidelines, but as you learn more you’ll be able to make a more informed decision about what you need to learn to advance in your career.

Don’t be afraid of learning “the wrong language”. Most things are transferrable to other programming languages. Also, while you may “know” what area of programming you want to work in, you won’t believe how many times you’ll change your mind, I know I did!

In this series, we’ll be mainly looking at Python code, with some C++ code from time to time. Don’t let this discourage you, because we will not go in depth of how exactly Python works. Instead, I will be teaching you the concepts that apply to any programming language.

And if you don’t know which programming language you should learn, once you find out, it will be much easier to learn it since you’ll already know another one!


Next: Chapter 5 – What is the difference between a compiler and interpreter?

If you want to start from the beginning of the series, go to chapter 0.

By Radu

Software Engineer and Computational Scientist graduated from the Technical University of Munich. Worked at Shopify, DRW and Ubisoft.

Leave a comment

Your email address will not be published.

Join my mailing list to get an email whenever a new chapter comes out!