This article is based on a Lightning Talk I made during the CppCon 2020: How many languages a (C++) expert should speak ? – Thomas Lourseyre – CppCon 2020 – YouTube.
The speaker is a bit stressed and fumbles with words, but I’ll try and elaborate on what he wants to says.
Why learning other languages?
Assuming you are a C++ developer, I’ll explain the reasons why you would learn other languages using two quotes.
If all you have is a hammer, everything looks like a nail.Maslow’s hammer
Say you are given the task to solve a programming problem/issue/dilemma. One of the first questions you will have to ask yourself is “What language should I use to solve this?”. If you only know C++, you can only answer “C++”. Obviously, C++ can not always be the perfect answer.
Even if you are not an expert in other languages, if you know the basics and can say “This language is better suited than C++” then all you’ll have to do is to find the appropriate expert. This is an insight you can’t have if you only know one language.
Those who cannot remember the past are condemned to repeat it.George Santayana
The programming industry is not a pink paradise where all projects start from scratch and you have all the tools you want in their latest versions. Sometimes (or often, depending on your position in the industry) you will have to work with legacy code. Sometimes it will be written in C++ and you’ll have to port it to another language, and sometimes it will be written in another language and you will need to translate it to C++.
In both cases, this is work you can only do if you know other languages than C++.
Asking the real question
With that said, I can safely state that the real question is not “Should I learn other languages?” but rather the following:
How many other languages should I learn?
The language knowledge table
I designed a table that ranks the languages one knows depending on their knowledge of them:
|Level of knowledge||Details||Personal examples|
|Expert level||It’s OK if you only know one.||C++|
|Practical level||Languages you tried and loved, and you practice regularly.||Python, C, Rust, Bash|
|Documentation level||Languages you practiced but didn’t like that much. You know how to fetch documentation though.||Java, C#, js, basic, perl|
|Hello word! level||You don’t know much about it…||Ruby, AS, Go, etc.|
You may have noticed that my personal examples have evolved since last year – it’s a good thing.
The levels of knowledge
There are four levels of knowledge depicted in this table:
- Expert level: These are the languages for which you are expertly reliable. A lot of developers have none, and most of the remaining have one. Some top-tier experts have several, but it requires to be very knowledgeable in both, so it’s quite rare. It is not a mandatory field and it’s OK if you have only one.
- Practical level: These are the languages you practice regularly but you can not say you’re an expert of. Usually, these are the languages you love and use for your personal projects.
- Documentation level: There are probably languages you tried to learn, practiced a bit but did not like. Maybe there are some languages you had to learn and practice for a specific project but immediately forgot afterward. These are languages you are not very knowledgeable in, but you know the basics and are able de to document yourself if needed.
- Hello world! level: These are the languages you basically know nothing about. Languages that you know by name, but wouldn’t be able to give the core specification. Maybe you wrote a “Hello world!” someday, but not much more.
The only useful levels of knowledge are expert, practical, and documentation. As soon as you can at least know where to fetch documentation, you’ll be able to make something out of the language. The Hello world! level is useless in that regard.
How to promote a language?
So your goal will be to try to promote (in the table) as many languages as possible. But the efforts it takes to promote a language depend on the level of knowledge this language stands on:
- From practical to expert: Becoming an expert in any field is time-consuming. You are not to become an expert unless you want to spend a lot of time on the language. You may want to, but it is a big investment of time you cannot do for the sole sake of being more polyvalent.
- From documentation to practical: If you try and force yourself to practice a language you don’t love, there is a good chance you will hate the said language even more. You can’t force love, and even you may have a good surprise (and end up loving a language you didn’t like at first sight), over-practicing a language you dislike for the sake of being more polyvalent is just pointless and self-harm.
- From Hello world! to documentation: What does it take to try and practice a new language to the point you make an opinion about it? In a matter of a few hours, you will be able to read the letter of intent of the language, learn the basics, and grasp how its documentation is organized. You may like it or not, but at least you will be a bit knowledgeable about it.
The most feasible promotion thus is from Hello world! to documentation level. If you are curious and try to learn the whys and hows of as many languages as you can, you’ll have a broader view of the world of programming.
So, how many languages should you speak?
The answer I provide you today, regarding all we said, is the following: as many as your curiosity can bring you to.
One of the main qualities of an expert (be it in C++ or not) is their curiosity. This is what pushes you to learn more, every day, about every subject. As long as you stay curious, you will learn and grow.
Don’t waste your curiosity on a single subject, curiosity is best employed in width that in depth.
On what basis should you learn and/or keep your knowledge of other languages?
The answer to that question is always closely dependent on the free time you can allocate to the activity of coding.
If you have an hour of free time you want to invest in development, pick a language you know by name but never practiced. Read the not of intent and write a simple program. This should be enough for you to know if you want to invest time into this language. If not, keep in mind where you can find the documentation in case you need it later (or bookmark it in your favorite browser, if you don’t want to remember it).
If a language appeals to you, then try to evaluate how much time you can spend training. You can follow tutorials, you can do exercises, you can develop new projects.
There is a good way to keep your knowledge of your favorite languages: Platforms like CodinGame offers training and challenges and include tons of different languages. Try it, it’s very addictive: Coding Games and Programming Challenges to Code Better (codingame.com).
Is it only restricted to C++ experts?
I can hear some of you sighing in front of your screen, “I’m not even a C++ expert, should I even bother learning another language?”.
All the arguments I detailed above are valid for both experts and non-experts. As a non-expert, in addition to that, you are (in my experience) more likely to switch to another language sooner or later. You could wait to get onto a project to learn the language it features, but then you’ll be taking the risk to end up coding in a language you dislike or don’t understand.
Knowing other languages not only makes you more appealing to those who seek new collaborators (most recruiters will prefer someone who trained a bit in the language over someone who never touched it), but you will have a small insight into what the language is all about.
Curiosity is good quality, in software development.
Thanks for your attention and see you next week!