As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
If this question can be reworded to fit the rules in the help center, please edit the question.

Many answers seem to ignore the clause above that the language will never be used. Learning a language to pass a college course or understand another developer's constraints counts as "using it" in my view.
–
SmandoliJul 13 '09 at 16:15

19 Answers
19

IMHO, it is all about learning a new programming paradigm. If you know Java and then C#, there's not much gain, once both of them have almost the same "type of programming".

But if you get to learn a functional language or dynamic, for instance, you're forced to think another way, and that will probably help you to program better in your favorite language.

It is something like: "It is so easy doing this in {different language you learned}. There must be a better way to do this in {language you already know}". And then you rethink, and build up a more elegant way to do this in {language you already know}.

Question for David T: So, you didn't use Lisp, and you knew you wouldn't?
–
SmandoliJul 13 '09 at 15:42

1

"...probably help you to program better in your favorite language". Or make you frustrated that Java or C# force you to write 100 lines of code to accomplish something that can be done with 3 lines in a dynamic language... Sometimes, ignorance is bliss. :-)
–
Javid JamaeApr 23 '11 at 21:41

Although most people do a majority of their programming using a single style (most commonly OOP over the past few years), I think that all programmers should know multiple styles so that they are better able to see the shortfalls of their own style.

An additional useful paradigm expressed in some languages is metaprogramming, both template (C++) and macro (Lisp). Learning to think in different kinds of abstraction can help understand the nature of problems and their solutions.
–
Michael EkstrandJul 13 '09 at 13:52

Question for chills42; So, you didn't use lisp? And you knew you wouldn't use lisp?
–
SmandoliJul 13 '09 at 15:44

Yeah, other than one or two simple emacs macros... I've never used it... The only reason I learned it was to try to be able to understand the language.
–
chills42Jul 13 '09 at 18:36

Can't shed much light on this in terms of programming languages, but it seems very similar to the "why learn a dead language?" argument that surrounds Latin, and much of the reasoning there can be applied here.

+1 for bringing out Latin. Now I cannot say more than rosa, rosae, rosam, rosas... but I think it was a delightful experience that helped me to know more about my mother tongue :-)
–
fortranJul 13 '09 at 13:45

Programming is a way of thinking, not writing code in programming language X: that is "coding", not "programming".

By knowing at least something about more than just one programming language - preferably across different paradigms, so imperative/OOP/functional/logical - you train that way of thinking about problems outside the context of the specific details and quirks of language X.

I think this always improves your abilities to be(come) a better programmer tremendously.

A great side-effect of learning new languages is the potential for application in your existing language.

For instance, I'm a Java programmer and I took the time to learn my first functional language (Haskell). I was recently asked to learn Scala for an upcoming project. This is extremely easy since I understand the comcepts of guards, recursion, etc. from Haskell.

Deeply learning language just for learning language has too little benefits. If you have a lot of tasks and you don't know language that ideal for solving it then it is make sense to learn that language. Otherwise it is make sense to spend the time to become expert in languages you already know.

I don't know that there will have been much rigorous study regarding the benefits of multi-programming language exposure on overall programming ability, but I would argue that the studies regarding why learning a foreign human language (which you may never use in practice) is beneficial would in general hold equally well for studying foreign programming languages. The benefits ascribed often include improved cognitive abilities as well as improved understanding of one's native language.

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.

@Smandoli - sure. I struggled to find the right word. I chose petty, but that is perhaps too pejorative. Limiting? Constraining? I hope you take my point, and that it's not meant to be a putdown.
–
Don WakefieldJul 14 '09 at 15:58

Knowing C and having to deal with memory management and do-it-yourself data structures can help you understand performance issues when programming in a higher level language where those details are hidden from you.

Conversely, learning an OO language can affect your C programming - with, for example, the concept of Polymorphism prompting you to use function pointers in ways you might not have otherwise.

Learning a language where functions are first class objects that can be passed around can make you think of similar techniques in other languages, even if, in those other languages, you have to make the functions methods in objects that get passed around.

Learning about the way Erlang handles concurrency can make you rethink how much shared state you use between threads in other languages.

Any language that has a built-in feature you find useful can prompt you to implement your own version of that feature in another language that doesn't have it, and thus allow you to solve problems in ways you might not have thought of if you hadn't been exposed to the feature in the language that has it built-in.

Learning about Interfaces in Java can make you think about the benefits of precisely specifying your (small "i") interfaces in other languages that don't have them as a formal construct in a type system.

Learning a language is not a binary event. If you are a decent programmer, you should be able to trust your own instincts as to whether a language offers you a new take on your craft.

Virtually every language worth considering these days can be downloaded and test-driven in a couple of minutes. So do it -- pick one and try it out.

There are a limited number of cases where this "laissez-faire" approach falls short. If you're a complete beginner, of course it doesn't work. When I first learned C, I had to have it beaten into me, but it did turn out to be worth it because it made me understand pointers, memory reference and dynamic allocation in a way I hadn't previously.

But if you know that much already, just poke around and look for a language that makes your lightbulb go on.

Different languages have different ways of implementing the same ideas. By learning new languages, you get a different perspective on how things can be accomplished, and can then use that knowledge to approach how you program in your current environment. Think about object oriented and functional programming. OO Programmers can learn a lot about parrellization from languages like C.

Learning a language, especially one that practices a new paradigm, is very beneficial for every programmer. For example learning Scheme will help someone understand functional programming. The programmer can later practice what he/she learned with other languages like C#. She can think of new ways of doing things.

Also, as languages evolve, it's high likely that the language you use will adopt some features of other languages. Having taught myself Ruby, I was able to grasp the changes in C# 3.0 much easier.

I think learning languages will always benefit you even if you don't use them again. I started playing with Ioke as an attempt to learn something experimental and because of it my JavaScript has improved because certain ideas have been cemented.

learning a new language will possibly give you new insights that you will try translate to your main language.

I don't think there will be any hard evidence--I think this is more of an intuitive thing. Learning a totally different language will help you look at things totally different. Or maybe it won't. In any case, what's the harm in learning something?

True. To stop learning is to die. My resistance is based largely on having a whole family and a half income. Sure, I have hobbies, but they don't happen to be programming, and that's all my time.
–
SmandoliJul 13 '09 at 15:53

It's entirely subjective, but way back when, after taking an undergraduate course in Haskell, I did notice that my programming style in C became more 'Haskell-like' for a while; I used a lot of simple, recursive functions. I also noticed that this programming style seemed to yield some of the same benefits programming in Haskell had; bugs were fewer, code was easier to understand (albeit slower).

So, while learning another programming language may not make everyone a better programmer, it definitely was a learning experience for me, personally.

What are the benefits of learning mathematics or physics that you won't use, or the benefits of studying philosophy or dead tongues?

It's the intellectual achievement and the enlightenment what matters, you will be a wiser person with any new thing that you learn, no matter if they are programming languages, literature, role playing games... of course if it's related to your working field, then you'll actually find a use, sooner or later :-)

I spent some time studying clojure even though I knew I wouldn't use it in the near-term (mostly because I can't really deploy on the JVM).

It has concepts that aren't supported by the languages I use (C#/C/C++/Python/Perl) and I wanted to know what I was missing and also if it would be worth looking into libraries that purport to add these features.

Specifically, I'm very interested in understanding Lisp-style macros and the direct concurrency support. I also spent some time reading the implementation, specifically the datastructures, which was very educational -- good to see a quality implementation of persistent datastructures to learn how they work (and give you immutability without sacrificing much performance).

Bryond what has already been said, I really like new languages just because it can bring new interest to programming. You learn different ways to approach problems and the strengths/weaknesses of certain languages. It is something new to learn and any good programmer should be striving to always be learning new things. It mixes up your daily routine of possibly programming in the same language for years.

I would add that learning languages you won't use in production work can be of value

To better appreciate and absorb the arguments and methods in texts and papers that will improve programming ability in languages I do use for production work (e.g. MIX/MMIX for Knuth's Art of Computer Programming; RATFOR for Kernighan and Plauger's Software Tools; I still use some ALGOL-based syntax for some pseudocode although I never wrote runnable code in ALGOL outside University)

To be able to check or prototype programs that will be written in a different language (e.g. some routines for numerical computing in C can be quickly checked or scaled using languages that have appropriate functionality built in such as Fortran, Python or Haskell)

Learning a new language can give insight as to how it could be used to more easily solve problems that were put to one side because of time or complexity constraints.