There are only two kinds of languages: the ones people complain about and the ones nobody uses.
The phrase above is from the creator of C++, Bjarne Stroustrup, and C++ is, until this day, one of the most used and powerful programming languages ever made.
Bjarne also has a nice point of view on learning programming as a craft in the sense that there is not one language to rule them all (did you like this Lord of The Rings reference?) like many people on the web will make you believe.
Sadly, it is actually quite easy to spot language wars, especially in social media: "learn language X and forget about everything else".
Become a world citizen
Making a comparison of programming languages with natural language, having a good knowledge of more than one language broadens your worldview immensely.
It allows you to understand small things in someone else’s culture, the way they express their thoughts, and how their society works in a manner you would never be able to understand due to noise or information loss in translations.
There is this concept of how the language you speak shapes your mind due to how you can express yourself.
The richer your vocabulary and sentence constructions, the better the abstractions you can create, and the more you can evolve as a thinker.
This concept is very well covered in the fiction book 1984 by George Orwell where this entity that wants to control society eliminates some words from the language, making people less expressive and slowly taking away their freedom.
Why learn more than one Programming Language
Each language has its own unique constructors and allows you to create things differently.
You might not like how Python deals with Object-Oriented Programming due to its unrestricted way of accessing methods and attributes in comparison to Java, but you can enjoy the simplicity it gives you to make simple things quick and easy.
This is not a matter of right or wrong, languages are designed with some aspects, some purposes, and some concepts do not get along well with others, making some design choices is really hard, but necessary to create a consistent language.
The important part is how each programming language will have a purpose, and how your ideas can be expressed clearly.
You can’t work very well with C++ if your knowledge of OOP is not very good. The concepts, the abstractions, they only seem easy in code when they are solid in your mind, until then you can’t unlock the full potential of the language.
The same goes for JavaScript and functional programming, although JavaScript is not a purely functional language, if you really understand concepts like immutability and pure functions, there is a whole another level to be unlocked.
While Java and C++ can make you go deep and understand OOP, languages like Haskell and Clojure will totally shift your train of thought when it comes to functional programming.
After that, you can use these concepts in other less restrictive languages like Python, Ruby, and JavaScript and even mix the concepts if that makes you express yourself better.
Start with two
How to start?
Simple, start with two.
Two languages, pick a compiled, statically typed language and a dynamically typed one.
Learn one, then the other.
You don’t have to become a jack of all trades, master of none.
Pick one to be your main language, but keep trying, if you know JavaScript really well, why not try some C++?
It will surprise you how much you can learn from the perspective of a different programming language and how much you can improve in your main language just by trying another one’s approach.
It gets easier after the first two, trust me, the second one is the most important to start this movement in your mind.
Some languages to consider
First things first, don’t make many lateral moves, try to get out of your comfort zone.
Choose at most two in each category to try.
How many should you try?
Bjarne Stroustrup says 5 is a magic number, I think it is a good rule of thumb to follow, but don’t feel restricted by it, try as many as you can.
Here are some languages to consider, but not limited to:
- Script languages: Python, JavaScript
- Functional languages: Clojure, Elixir
- OOP languages: Java, C++
Consider reading this other article Machine Learning for Humans: how to learn better and faster? where I talk about a learning process that resembles Machine Learning, but applied to us, humans.