Dear new developer,
Learn two languages.
You can also know one non dominant language and get pretty far, though if that is your choice, you will probably be happier at a big company with supporting infrastructure. Something like ruby for web development or go or rust for systems programming.
But, knowing just one language is like living in the same town all your life. You can be happy doing that, but just the exposure to life in a different city will shake you and show you that what seemed like a universal truth was actually just an assumption.
I cut my teeth on perl and wrote a lot of it for my first professional job. Then I had to write some java. The first java I wrote was not idiomatic. Rather than use small custom objects, I just leveraged hashmaps and lists for my data structures. I remember one of the other engineers going over some of my code and saying “that looks a lot like perl written in java!”.
Specifically, learning a new language will:
- let you see the strengths and weaknesses of your first language
- let you bring concepts from language number two back to your code in language number one
- make it far easier to learn a third language, should you choose or need to do so
- make you aware of different approaches to common problems
- may make it easier to implement certain kinds of problems. In my experience this is often due to open source libraries that may be available for one language that aren’t for another
- make you less passionate. This may seem like a strange benefit, but learning another way to do things often helps you realize that a programming language is just a tool, and that different tools are of course better for different things.
- let you build a mental map to apply to the new language based on the old language. “I know that there’s a way to iterate over a list in perl, so there must be a way to do so in java.” This will also help you learn common software terms (like “iterate”) which will help you in your searching.
These truths apply not just to languages, but other pieces of the software development process. Learn two of everything. Databases, frameworks, development methodologies. The increase in perspective and the ability will be worth the extra effort.