Nupul asks: A lot of my peers seem ready to dive in to learn "the next new thing"—lately Python, Ruby or PHP. But it seems that just "knowing" the language is futile. You also need to know the frameworks, learn their usage/APIs and become familiar with good implementation practices.
This is a lot of work. Does it really make sense to expend that energy to learn a new programming language? Learn it quick and dirty, and you'll probably use it for quick and dirty prototyping and implementation.
Isn't this enough?
Top answer: "invest in yourself" (111 Votes)
Learn at least one new language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut. Additionally, learning many languages is far easier now, thanks to the wealth of freely available software on the Internet.
It's not about the next "new thing." It's about thinking in ways outside of your normal thought patterns.
There is a saying: "When you're a hammer, everything looks like a nail." Maybe there is a better way to solve a problem using some other technology. If you don't explore, you may not know that it was available.
Alternative answer: "let me count the ways..." (47 votes)
Mike Brown replies: Why do people climb Mt. Everest? Or run 100 miles in 24 hours? Why do we undertake any challenge? Because it's there. I see nothing wrong with "Ars gratia artis." There comes a point where learning for learning's sake becomes its own reward. But if you want more powerful reasons to learn a new language, here are some:
- New ways to solve problems: Learning a new language—really taking the time to dive in—gives you the chance to program again as a newbie. That new perspective can teach you techniques that might carry over to an old language. Think of the influence Ruby on Rails had on ASP.NET MVC or how Java Hibernate was ported to C# (along with countless other frameworks that influence .NET development). Exposure to different languages can teach you new ways to address problems.
- The right tool for the right job: All of the languages you mentioned are OO/Procedural hybrids (or purely procedural in the case of C). Try your hand at a functional language or two. Try implementing factorial in Erlang using recursion and watch your jaw hit the floor when 20000! returns in 5 seconds (no stack overflow in sight). Then look at the power of scaling your application to crunch through numbers and parse protocols with less code and in less time than it would take to get two instances of a JVM talking through RMI or SOAP. Learning other languages/frameworks that are targeted to solve specific problems will give you more tools.
- Meet new people/expand your network: Diving into a new language exposes you to a new community. Meeting new people is a good thing for your career and personally.
- New opportunities: Knowing a new language can only increase your chance of getting that job with that hot startup. "Man this job would be perfect if I knew Ruby." Besides, you might enjoy the language enough that you decide to switch paths.
- Keep it fresh: Working with the same thing day in, day out becomes tedious. Using a different language can give you a break from the daily grind and allow you to come to the next day refreshed.
- Because it's there: Learn a new language because you want to.
Alternative answer: "more languages, more money" (4 votes)
Alternative answer: "analyze and choose wisely" (2 votes)
Fabio Ceconello replies: I have about 15 years of experience in C++ and 5 in Java. There are many languages I learned and left behind (PHP, Pascal, assembly for a bunch of different processors, among others) and can say for sure that even those I don't use anymore left a significant mark on how I think about a problem. Also: even if you want to stick with, say, Java, for a given project, you'll have to know the alternative to present good counterarguments to its proponents.
Still, I learned Python just this year, and was delighted by how elegantly some things can be done. So much that I decided to convert a handful of REST servlets I had written, from Java to Python. The advantages in code maintainability were significant. For sure it left a mark on my way of doing things, too, not only because I will now choose Python for some tasks, but also because I may adopt similar design principles when coding in C++ & Java.
That said, I don't think you should learn lots of different languages just for the sake of it. It takes a considerable time toll, and the "accomodations" you'll have to make to let new languages coexist with old in your mind also take time and effort.
I only decide to learn a language when it has enough maturity, has a good developer base, and offers significantly different outcomes from the others I know or plan to learn. When I decided to learn Python, for instance, I also considered Ruby and Perl, and later discarded them—at least for the near future.