Related: Learning new skills
While many people working as programmers/software developers are happy enough specializing in a single programming language or platform, I generally consider it a better idea to have a wider toolset and the ability to easily pick up new programming languages as needed. The benefits should be obvious: when you have a wide variety of tools under your belt and are able to quickly learn to use a new tool, the number of work options you have increases greatly.
Happily, programming languages share a lot of similar constructs. Only your first programming language (when you first learn programming) should provide you with any difficulty – once you’ve cleared that hurdle, learning additional programming languages shouldn’t be too much of a concern.
You typically start with syntax, variable declarations, function declarations and program flow (loops, conditionals and so on). Some languages may have a strange syntax that don’t share much in common with other programming languages, but that’s pretty much not a concern as long as you have access to a modern-day compiler that will tell you when you stray from the desired syntax.
I find that learning a programming language is best done the same way you actually program – iteratively. Learn something new, try it out, modify it a bit, try it out, and so on. I once had to help someone prepare for a programming interview where he would be expected to know C++. He had learned it before in college, but hadn’t used it for a few years, but for some reason he stuck to reading up on it instead of taking my suggestion to install a compiler and actually try out all the suggestions. (He ended up passing the interview, but that was luckily because they didn’t ask too much about syntax.)
It also helps a lot to learn about theory and terms and whatnot. Like for object-oriented programming, it helps to know and understand the concepts behind polymorphism, inheritance, abstract classes and so on. When studying different programming languages, you can then easily compare how they are done in one language vs another, making it easier for you to carry over design concepts to the new language you are learning. Being familiar with the terms and vocabulary also helps you communicate better with mentors, teachers, and fellow learners studying the same language.
Building small toy applications with the new programming language is a great way to learn too. Or maybe if you had a certain project in mind that you wanted to do, you could use the new language with it. Slightly related: When I was consulting with a startup on developing a new product, I asked the CTO whether he preferred to use a technology stack that the developers were more familiar with (to reduce learning costs) or whether he wanted to try this different language that neither of us had tried before, and he told me that one of the great things about being in a startup was that he could choose to do new projects with new technologies to expand their horizons and not have to listen to higher-ups shut it down for fear of increased costs.
For the longest time, I tried to learn at least one new programming language/platform a year. For 2016, it was Unity/C#, although I’ve also started studying Node.js in the past month or so. I hope it’s something I’m able to keep up, even as I’m trying to explore new skills other than programming.