Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm quite proficient with Java, C/C++, JavaScript/jQuery and decently good at Objective-C. I'm quite productive with the languages and their corresponding frameworks too and do produce enterprise level systems (and also small scale ones) with sufficient ease all the while keeping code 'clean' and maintainable (yes, I can read my own code after six months :)

Unless mandated by the platform (iPhone, iPad, etc.) or by the client/implementation organization, just "why" should I learn a new programming language? Just for "fun"? And do what with that fun if I'm not going to do anything worthwhile with it?

A lot of my peers are ready to dive in to learn the "next new thing/language" and it's usually Python, Ruby or PHP (just naming a few popular ones). Now, just knowing the language by itself is futile IMHO. You also need to know the frameworks, learn their usage/APIs as well as 'good implementation practices', etc.

So from an 'economic' sense, is there any benefit in learning a new programming language? If the language is learned in a quick and dirty fashion, it'll probably also be used for quick and dirty prototyping/implementation - but I don't see THAT as a justifiable investment of time/effort.

So just WHY should I (or anyone for that matter) learn a new programming language other than "it's fun so let's try it out" - if the investment of time may not be worth it in the long run?

share|improve this question
6  
programmers.stackexchange.com/questions/118338/… Maybe you'll be interested by the answer I gave gere. –  deadalnix Feb 21 '12 at 17:28
23  
-1 This sounds more like a rant than a question. Why do you assume that you should learn a new language? If you have no interest and see no benefit, perhaps learning another language isn't the right choice for you. If you decide to learn a new language, or anything else for that matter, you should do it for reasons that make sense to you and not because someone on a web site or a bunch of your friends talked you into it. Think for yourself. –  Caleb Feb 21 '12 at 21:51
3  
If you can see a new language with new concepts and not have a desire to understand them, many places won't hire you (in fact, many interview questions are made to specifically determine things like this) –  Bill K Feb 22 '12 at 0:03
3  
I'll ask why shouldn't I learn a new language? –  user Feb 22 '12 at 1:43
2  
@ZacharyK even if the job was for a java developer, and the candidate was superduper at java. Sounds like you might be shooting yourself in the foot. –  NimChimpsky Feb 22 '12 at 11:09

17 Answers 17

up vote 159 down vote accepted

From The Pragmatic Programmer, Tip #8 "Invest Regularly in Your Knowledge Portfolio":

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 different 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.

share|improve this answer
38  
I thought it was when all you have is a hammer everything looks like your thumb –  Zachary K Feb 22 '12 at 7:46
1  
I completely agree. I'd also add that learning another language helps you to better understand aspects of languages you previously thought you knew. It also helps to distinguish what are "real" programming fundamental concepts/patterns/limitations, and what are merely artifacts of your particular toolset. For instance, if all the languages you know are weakly typed, you might never know that strong typing exists, and never wonder why! Consequently, your products might suffer in performance or safety, even though they might excel in time-to-market ;-). –  JJC Feb 22 '12 at 12:24
3  
The Pragmatic Programmer is one of the best programming book I have ever read. Really good! –  Soner Gönül Mar 2 '12 at 13:14

Each one of us decides on what we want to work on so...

  1. you learn it because you want to
  2. you learn it because you need it for the job that you want

If you don't want to learn PHP, no one is making you and there's a ton of areas where you can program without ever knowing even how to spell PHP.

A lot of people look at the job market to see where hot areas area and jump on those technologies. A lot of people learn one language and stick with it and 20 years later they become legacy maintenance engineers. And then you have a lot of people who are anywhere between these two extremes.

In the end, it is all about what where you want to be.

share|improve this answer
1  
@PéterTörök: Edited my answer. I was pointing out the scale, but was too lazy to spell all out. You are right, it is a continuous spectrum. –  DXM Feb 21 '12 at 18:28

There are several reasons why learning a new language may be worth an investment in time:

  1. Increase the size of one's tool box - learning a new language can provide additional paths to solving technical issues. The possibility of new tools could provide a better choice of language/platform for solving certain problems than the tools/languages that one previously knew. A simplistic example might be that of a programmer who only knows C. Learning a scripting language opens up other possibilities for him/her - in terms of deployment, environment set up, etc.
  2. Gain access to a new platform - an excellent example might be Objective C - if one wants to develop for iOS, learning this language is almost mandatory.
  3. Learn new paradigms - certain languages might have better access to newer paradigms. Using C as an example, it might be difficult to develop web services in standard ANSI C. However, learning to develop in .NET, Java, PHP, or other new languages might speed development of web services.

Learning new languages can provide immediate benefits, as you've already noted, in "quick and dirty" solutions. However, these immediate solutions might lead a programmer to investigate and dig deeper into the architecture associated with the new language to "properly" learn it. One can view these quick learning exercises as an investment into the investigation of whether a new language is worth addition training time.

share|improve this answer

Not only do you want to learn new languages you want to learn languages that are different from the ones you know already If you know Java learning C# will not really challenge you, they are fairly similar. Ideally you should pick a language that is very different from what you know. If you know java, JavaScript and Objective-C you want something very different

Such as:

Ruby a fun weakly typed OO Language

Prolog A logic programming language very different

Erlang Concurrency and Fault Tolerance done very well

Scheme Go read SICP and reach enlightenment

Haskell One of the most powerful type systems in the world if it compiles it will probably work, also will keep you from making all sorts of strange errors and lot more.

Or just pick up Seven Languages in Seven weeks which will do about what the title says it will.

share|improve this answer
2  
+1! An exercise I am doing right now is to implement the same algorithm (merge sort) in different languages: this really gives me a feeling of how many ways there are to express the same computation. I have already the C, C++, Pascal, Java, Scala and Haskell versions running. Python, Ruby, Modula2, Scheme are on their way. I find you can learn so much by looking at different programming languages! And by doing one thing in one language I can get many ideas on how to implement it in a better way in another language. –  Giorgio Feb 21 '12 at 22:39
3  
I like this except for how you describe Haskell. You can still write wrong code that compiles. (Type-correctness is not the sole requirement for overall correctness.) The reason to learn Haskell is that it is notationally very close to mathematics, and it has a lazy evaluation model; that should shake up most programmers' notions of what programming is all about. –  Donal Fellows Feb 21 '12 at 22:55
3  
@DonalFellows in my experience if you get the types right in Haskell, the rest of the program tends to write itself. –  tobyodavies Feb 22 '12 at 1:53
1  
"Ruby a fun weakly typed OO Language": Is Ruby really weakly typed or rather dynamically typed? –  Giorgio Feb 26 '13 at 13:11

We think with words. The language we use influences the way we do it. There's an interesting case about Pirahã language - people speaking that language can't handle as something apparently "simple" or "intuitive" as numbers because the language they have been brought up in has no words for "specific quantities" (not even "one" and "many").

With programming languages is the same. A new programming language, can "open up" your mind to some aspects of programming.

Given your current programming background, I recommend you to learn some functional language, like Erlang or Scala. Finally, Clojure is a very solid language, too.

If you want to feel a bit more at home first, try a powerful scripting language like Python or Ruby.

share|improve this answer
22  
+1. "A language that doesn't affect the way you think about programming, is not worth knowing." -- Alan Perlis –  ruakh Feb 21 '12 at 19:08
2  
I reject the premise that “We think with words” as it denies the possibility that anyone (or anything) without words can think. But words are extremely useful for labeling concepts (and so helping to distinguish them). We mostly do our higher thinking with (much involvement from) words because it is efficient. Which is a more equivocal statement, but I think closer to the truth. Funnily, I can't reject the use of words without using words… –  Donal Fellows Feb 21 '12 at 23:06
1  
@evilcandybag: As it happens, I actually can demonstrate a source: sciencemag.org/content/306/5695/496, sciencemag.org/content/suppl/2004/10/15/1094492.DC1/… (PDF). –  ruakh Feb 22 '12 at 16:12

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 it's 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 site). 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.

share|improve this answer
3  
+1 Javascript can be functional, but it certainly looks like the OP maybe missing a few paradigms from their toolbox. And more experience with functional languages will give deeper insight with their existing languages e.g. with C++ templates –  jk. Feb 22 '12 at 12:32
1  
LOL, yes that is not what makes Erlang a pure functional language but it's a total change in perspective. In imperative languages we are encouraged to avoid recursion for all but the most trivial cases and Functional languages recursion is a way of life. Pattern matching as opposed to if/else or switch/case are pretty cool too. –  Mike Brown Feb 22 '12 at 21:00
2  
Try implementing factorial in Erlang using recursion and watch your jaw hit the floor when 20000! returns in 5 seconds (no stack overflow in site). This is one of the strongest arguments for learning a functional language I've ever seen. Never thought that it could be so efficient. –  Olegs Jeremejevs Nov 23 '12 at 11:47

Anyone can create a new language; but nobody seems to understand that "better" is rarely the same as "so much better that the cost of adoption is actually justified". The end result is hundreds of different languages, where it's impossible for anyone to understand all source code, and where programmers need to waste about a quarter of their time being unproductive due to language/framework/library differences.

In an ideal world, there'd be one low level programming language (e.g. C), one high level "safe" programming language (e.g. Java) and one scripting language. There'd also be a large sledge hammer for destroying the "Programming Language Tower of Babel" created by people who don't understand the virtues of standardisation and the cost of "churn" and constant retraining on the I.T. industry as a whole.

From a 'macro-economic' sense, there's nothing wrong with learning a new programming language as a hobby, but using that new programming language for anything makes you part of the problem.

share|improve this answer
4  
Sounds like a pretty impractical ideal. Who would decide these standard languages, and how do you decide that a new language is worth changing to? What about the risk of getting stuck in a crappy language just because no one is willing to try anything new? Imagine if we had done this 10 years ago -- Everyone gets to use C++ and Java (or maybe VB)! –  Brendan Long Feb 21 '12 at 18:48
3  
Your concept of "ideal world" sounds suspiciously like that of Nineteen Eighty-Four. In your Newspeak, revolutionary ideas like "functional programming" and "type inference" and "first-class polymorphism" and "multimethods" couldn't even be thought, because there'd be no way to express them. Admittedly, Orwell doesn't seem to have thought of your sledgehammer idea, but if he had, I'm sure it'd have found its way in. –  ruakh Feb 21 '12 at 19:05
2  
In addition to the points above, very little of your "answer" is relevant to the actual question. Downvote. –  user16764 Feb 21 '12 at 21:01
3  
In an ideal world, there would only be one answer to Nupal's question. Having all of these additional answers after the first one by people who don't understand the virtues of standardization just causes confusion. There's nothing wrong with disagreeing with the answer in your own mind, but posting an additional answer makes you part of the problem. –  benzado Feb 21 '12 at 21:02
1  
Restricting to those languages wouldn't prevent any of the problems you mentioned. I had to rewrite application many more times due to changing frameworks than changing languages. –  Fabio Ceconello Feb 21 '12 at 22:23

The best argument I know is that it broadens your perspective on how many different ways a problem can be solved, or some logic can be expressed. Knowing well Java and C++ gives you a good view on both the native & VM realms, but there are much more "degrees of freedom" to explore.

I have about 15 years of experience in C++, 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 quite 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 all the time, just for the sake of it. It takes a considerable time toll, and the "accomodations" you'll have to make in your mind for them to coexist with the others you already know 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.

share|improve this answer

At this point in your career, you should learn new languages if you think they will make you a better programmer.

Most of your listed languages (Java/C/C++/Javascript/Objective-C) are conventional OO/imperative. Learning yet another OO/imperative language will probably not teach you much more about that kind of programming. Unless you have a particular interest, there is no point in learning the flavor-of-the-month on spec.

I am also inclined to be skeptical about claims to order-of-magnitude productivity increases. However, it might be worthwhile to check out the occasional reputed high-productivity language, to see if you like it.

The best reason to learn a new language is to learn skills of general applicability. For that, I would recommend a deep dive into a functional language (Haskell, or one of the Lisps) on one hand, and assembly code and systems architecture (x86 or ARM) on the other.

Functional programming will break your brain and improve your mind, while learning machine architecture will improve your debugging and optimization abilities, even if you never write another line of assembly.

share|improve this answer

Your question is such a leading one that it begs me to ask the following question:

If you are programmer by profession, why in the world wouldn't you want to learn something new to add to your professional experience?

Your question sounds to me a lot like the attitude of a student I once had. A year or two before Y2K I was teaching a Cobol class (as an elective), at the request of the Director of Career Services at the university where I was teaching at the time. He had so many companies approaching him with job opportunities for Cobol programmers that he thought we would be doing our students a disservice by not giving them the opportunity to learn the skill and add to their skill set.

I had a student who took the class as his last elective class to graduate. He was also working as a C Programmer at the time. He took the Cobol class because he had no other choices and he wanted the degree. So he came to the class with a chip on his shoulder.

I already know C, and I'm using it professionally so I don't know why in the world that anyone would want or even need to learn Cobol.

So I challenged him with the task of writing a program to read data from a file that had a specific format for each record of input (ie how many characters each field took up on a line, which field came first, second, third, etc.)

He was to write his program in C, which he did, and he showed off his program to me. At the same time, I showed him my Cobol version of the program.

Then I threw him a curve ball:

Supposed that the end user is getting data from somewhere else. It's the same fields in each record, but the order and the number of characters per field is different. Show me what you would have to change in your program to make it work with the new data format.

He took a day to make a new version of the program that worked with the new data format. It involved changing at least 20 or 30 lines of code, and modifying several functions and modules.

Then I showed him the changes I needed to make to my Cobol program. I modified the picture clause to reflect the new data format.

I'm not sure he completely understood the lesson of that exercise, but he at least quit complaining for the rest of the semester.

So - in answer to your question: You should learn new languages because you want to LEARN. And if you don't want to learn - more power to you... (I'm just not sure I would hire you with that attitude)

share|improve this answer
6  
While your intentions were good, if I were that student I would simply think that the only reason your app was easily changed was because you knew of the eventual requirements change. If the program were written in C with the same knowledge, minimal changes would need to be made there as well. –  hspain Feb 21 '12 at 22:47
3  
all requirements change sooner or later! That is kind of the point. –  Zachary K Feb 22 '12 at 7:48

Alfred North Whitehead wrote a great essay called "The Importance of Good Notation"

It is interesting to note how important for the development of science a modest-looking symbol may be. It may stand for the emphatic presentation of an idea, often a very subtle idea, and by its existence make it easy to exhibit the relation of this idea to all the complex trains of ideas in which it occurs.

A programming language is a form of notation. I can code OO in C; in fact that's how Stroustrup started with C++--as a series of C precompiler macros. However, it is far easier and quicker to write OO code in either Java, C++ or C# because they have language primitives present which support OO more easily.

All the reasons for learning new languages given so far are valid but I think the best reason to learn a new language is that a new notation may enable you to think in a new way which may help you to solve new problems.

share|improve this answer

People learn new languages to...

  • expand their knowledge. If you know more you feel better and you're more confident.
    Confidence = Awesome Code!
  • have a bigger toolbox. Let's say you have to make an app. If you only know Java, you're going to make the program in Java. But if you know Java, Python, Scheme, and Lisp, chances are you're going to pick the best tool for the job.
  • get a job. Face it. If you know more languages, you have more job opportunities. That's pretty self-explanatory.
  • become a better all-around programmer. If you know the syntax of Perl, you know it can get a bit crazy. When writing long programs in Perl, you're basically forced to follow best practices, or you will not be a happy camper. Since you know Perl best-practices, this might help you write better PHP code (in one way or another).

So as you can see there are many reasons to learn a new language. My advice to you (and my only original quote that I think is good):

Write code frequently; Write code well; Write code in Scheme, PHP, Java, Python, Lisp, Perl, C, C++, C#, Visual Basic, Ruby...

share|improve this answer
1  
@Nupul: Or at least I think the quote goes like that... –  Dynamic Feb 21 '12 at 20:45

In a word: Marketability.

You open up your employment prospects when you can display that you have the ability to adapt and learn new things. Sure, you could keep writing applications using the one language you have become really proficient at, but what happens when you learn that your favorite language of choice becomes irrelevant for the industry that you have been working in. I actually remember a time when we used to write our own web services from scratch in C or C++, nowadays we use tools that do all the underlying "webbiness" for us (Think Rails, etc...).

The point is, you end up like those actors who do a TV series, and then can't easily move onto anything else because they are forever seen as their original character. "Who on Earth wants Captain Kirk to be Indiana Jones?!!". The same with programmers who have only ever used the one product. Sure, you'll know it like nobody else, but that won't help you when you're treated like you've been boxed up as a Fortran who cant move on to working with C#.

If you want to be able to move jobs easily and keep your options open, you need to broaden your experience. Work on many different projects in many different languages, and preferably on at least 2 or more platforms, and keep yourself marketable for more than just being what you are today.

Of course, there are lots of other reasons to learn a new language, sometimes even just for the hell of it. It opens your mind to other possibilities, so when your boss comes up to you and says "can we do something", you can say Yes with a choice of tools available to you.

share|improve this answer

The value of learning a new programming language is, roughly, the reciprocal of the number of programming languages you already know.

This is because there are a finite number of paradigms and learning a new language will usually introduce you to at least one or two, making you more experienced and capable as a programmer. Some may turn your programming world upside-down. But when you learn a new language which features paradigms you already know, you already know them and you're used to them.

share|improve this answer

I agree with most of the answers posted already. To append to these, check out the stats taken by the 2011 Stack Overflow User Survey. There was a very high correlation between number of languages known and money earned. They may not be directly tied to one another, but it is something to think about.

People who tend to learn more languages tend to make more money.

http://blog.stackoverflow.com/2012/02/survey-results/

share|improve this answer

As most of them written already, I have good working knowledge on C. Recently, I was working on some problem for which I needed to cross check the results; it was mathematical. So what is the fastest way to get the answer gave me a kick to check around faster programming language to be learned.

And I found out that bc, an arbitrary precision calculator language, the utility almost available on every Unix platform.

I didn't think of Python, Perl or anything, but I found out this solved my problems in a snap. I checked it out on the factorial(20000) that one of the friend suggested, and it gave results in a snap without any crash.

It is important only to a certain point that you need to know a new language which will ease your job/problem at present.

Definitely, if I write this in my resume I guess nobody cares, but from my perspective it solves my problem before I attack it in my favorite language, 'C'.

And also if there is a need to learn a new language you will get the opportunity with different problems and n number of solutions.

share|improve this answer

Most or all of the answers above are related to the profession. Programming. I want to remind that before we are programmers - we are human beings.

One good reason why not learning a new programming language, in your case, is to let your self rest or do other things beside programming.

From my experience, working in agriculture and working with wood, thought me a lot about programming - more then learning a new language. i.e. To be a good programmer you should first be a good human being. If you don't have much experience in life, beside programming, your idea about programming might be totally wrong - even if you are an expert.

Many concepts in programming are coming directly from the daily life: simplicity, maintainable, practical, useful, fast - and sometimes slow, modularity, etc; are all concepts which are used by a carpenter, for example.

Believe it or not: personally I've learned much about programming concepts, by taking a long vacation for picking oranges. The main concept I've learned from it was - simplicity. From working as a builder I've learned another concept: build the base as good as possible - if you want the walls to stand straight.

Finally, the answer for your question might be: take a vacation, join a taekwondo class, or take care of the garden - then your question may not bother you anymore.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.