Short answer: it depends.
If you are just getting started with programming, then I would recommend keeping it to one language at a time. This is because when you are starting out, there are a lot of things you are learning at once and the syntax and properties of the language are just one of those. Once you have established an understanding of good programming principles and how to use the tools of the trade, then you’ll have the skills and context you need to appreciate the differences between languages and weigh their pros and cons for your next project.
To elaborate, when you are getting started, you’re not just learning a programming language. You’re learning how to organize your project, how to use your editing tools, how to run and debug your application, how to find and use libraries and frameworks, how to manage dependencies, and generally how to accomplish the thing your project is trying to do. Add to that list major coding concepts and patterns, like Separation of Concerns, keeping your code DRY, Composition versus Inheritance, and the patterns and anti-patterns of the platform you’re developing for, and you’ll start to appreciate how much you already have on your plate! They say that the best way to eat an elephant is a bite at a time, so do yourself a favor and stick to one language to get started and keep the new things to a manageable level.
On the other hand, let’s say you’ve got already got some good grounding in those concepts and you’re ready for something new. Should you consider learning a new language? Absolutely! Learning a new language highlights the differences between languages and makes you ask “why?” You will not only learn the new language – you will understand the languages you already know much better as well.
And, if you have the bandwidth for it and feel the desire to, you can even go for two new languages at a time. The most important thing is that you have a solid foundation to build upon. All of that being said, let’s turn for a moment to the question of why you are thinking about learning a new language and what to consider in making your selection.
A host of tools for every job
An important thing to remember is that different languages are intended for different jobs, and understanding what a language is best at should be a major factor in choosing what language to learn next. The common scenario is that you want to do something new and you have to learn a new language in order to do it. For example, if you want to get into building web front ends, you’re probably going to need to learn some Javascript. If you’re interested in picking up machine learning, you’ll probably want Python for that. Building a back end service in the cloud? Consider learning Java. Each of these languages has attributes and properties that make it a good fit for the place it’s being used.
Unfortunately, it’s not quite as simple as one language per platform. There are often several available languages you could use for your project, so how do you choose the right one?
Perhaps the best example of death-by-options is in mobile development. Everyone who knows how to code (and almost everyone else) has wanted to build a mobile app at some point, right? It turns out there are many ways to do it, each with pros and cons. You could go fully native and learn Swift for iOS and learn Kotlin for Android, but that’s two languages you would have to learn to do one job, two code bases to develop whenever you add a feature, and two sets of native libraries to learn. That a lot of work!
Alternatively, you could develop for both mobile platforms using frameworks that offer a write-once-run-anywhere promise. Some examples include ReactNative (Javascript) or Flutter (Rust) or Xamarin (C#) to name a few. This will leave you with one code base to manage, but limits your access to native APIs and can make debugging harder. It’s a tradeoff.
This abundance of options is not limited to mobile. Web front ends can be built in Javascript, but also Typescript or Coffeescript. You could choose to use libraries like React or frameworks like Angular (but please don’t). Backend applications can be built in Java, Javascript (back again!), C#, R, and more. If there’s a platform for development, it’s almost a guarantee that there exist a few languages that can be used to develop for it.
So which one should you choose? There are two factors that make a new language the right fit:
How to pick your next language
1. Learning Gap
It’s great that you get to learn new things all the time – that’s one of the best things about developing software – but at the end of the day you are trying to accomplish something in the market. So when picking which language to use for the job, consider which language employs patterns and concepts that you are already familiar with so you can stay focused on solving the problem your project is intended to solve. Learning the patterns of a new language and how to debug it can make life hard for a developer when the pressure is on.
2. Resources
Next, consider how much community support there is for the languages you have to choose from. The best language is often the one where common problems have already been solved and you have ready access to help if you get stuck. One way to test the water is to go to a community hub like Github or StackOverflow and see how much activity there is around the language you’re considering. This also helps you identify the community favorite (if there is one). If a lot of people have landed on a particular language to solve problems similar to yours, there’s usually a reason and you should weigh that in your decision.
Conclusion
If you’re just starting out with programming, keep it simple and focus on building a foundation of good principles and practices in one language. Then, as the need arises, you will have legs to stand on when you want to expand your knowledge to new languages for solving new kinds of problem. When you do, you’ll not only learn a new language, but you’ll understand your first language with new perspective and renewed appreciation. All in all, you’ll become a better developer with a firmer grip on which differences between languages matter and which ones don’t.
When making your selection of what language to learn next, think holistically and pick the option that best helps you accomplish your goals both now and in the future. Consider the community support and your access to existing solutions to common problems. The broader and stronger the shoulders you have to stand on, the higher you can reach.
Finally, is it wise to learn two new languages at the same time? If you have a good foundation to stand on, and you see a legitimate need, then go for it my friend, and may the digital wind ever be at your back.