Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you decide that now is the time to go and try another programming language? How long do you think does it take for every programming language to grasp?

share|improve this question

closed as primarily opinion-based by World Engineer Jul 21 '13 at 8:13

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

One a year is good. Of when you are in the mood for it. Check out Seven Languages in Seven Weeks from the Prags. – Zachary K Mar 17 '11 at 7:41
when it starts paying less :-) – sushil bharwani Mar 17 '11 at 12:11

14 Answers 14

up vote 11 down vote accepted

If you feel like you have mastered the language, you can switch to another but. But the thing called mastering is vague.

Therefore a good practice in my opinion is choose few languages (less than 5) in your career path and learn things in them without concentrating on every language in the world.

share|improve this answer
Scheme is a language you can master, it is so small, but already C might be getting a bit hard (but still possible) and Java and Python (with standard libraries) would be close to impossible. – Anto Mar 17 '11 at 8:12
You have to learn many other (and different) languages in order to master a single one. Otherwise your brain won't be flexible enough to do the un-obvious and counter-intuitive things in a language of your choice. You won't even try, for example, to simulate a pattern matching in C#, if you've got no experience with ML-like languages. You won't be able to embed a logical engine inside your C++ code if you know nothing about Prolog. And, remember, if you're ignorant about the other languages, you're bound to follow the Greenspun's Tenth Rule. – SK-logic Mar 17 '11 at 10:46
@Anto, I beg to differ. Because Scheme is so simple, it is also very flexible. Because it is so flexible, the number of ways you can use it to solve problems is astounding. You can't truly master it. As with all languages, there will always be something to learn. – Berin Loritsch Mar 17 '11 at 12:31
@Berin: Well, that kind of mastery is of the paradigm, or the recursive kind of problem solving approach, which Scheme uses; not core language. It depends on how you look at it. – Anto Mar 17 '11 at 15:31
@SK-logic: you're spot on. I'm far from having mastered C++ (a hell of beast...) and I've already delved into Python and be contemplating Haskell for a while (C++ template metaprogramming is somewhat akin to functional programming, because of the purity / immutable values) – Matthieu M. Mar 17 '11 at 18:49

I learn a new language when a new project:

  1. can only be done in the new language
  2. can be done a lot better/easier in the new language
  3. the new language is simply fascinating

(Recent) examples (for myself):

  1. objective-c for iPhone programming
  2. from cgi perl to ruby on rails for web programming
  3. ruby, lua
share|improve this answer
+1 given you can never really be sure of your mastery in a language the motivation would be better served/directed along these lines of thought – Aditya P Mar 17 '11 at 12:51

I encounter many languages in my work so I need to know (and came to know) quite a lot. However, I would prefer to use as few languages as possible because it is easier to become very good at a single language than to become very good at many.

That said, I do think that you can benefit a lot from knowing a couple of VERY different languages very well.

Without starting yet another flame war, I consider C#, Java, VB.NET and C++ very similar when looking at the syntax and, in general, their use. In the same way I consider Haskell, OCAML and F# also to be very similar. What I mean to say, learning VB when you know C# doesn't add much whereas learning Haskell when you know Java is a very good thing.

The same goes for query languages (SQL, LINQ, XPath, RegEx, jQuery) and scripting languages (javascript, powershell, ...)

It is better to learn languages from different groups than all languages from a single group because it will help you to use the fitting language for your problem. Instead of adding more hammers you'll be adding glue, a screwdriver and some cello tape to your toolbox.

In short: learn an imperative language, functional language, a query language and a scripting language and be open to learn new categories.

share|improve this answer

There's actually no real point in trying to learn as many programming languages as possible. Speaking from experience, it is quite likely, that you still haven't learned all aspects of the languages you know, and there might come a moment, where you'll learn something new, and it feels totally awkward when someone teaches you something about the language, you thought you knew so well.

I learn the languages that I have to know. For my last assignment, I had to learn TSQL, and not just making code that just works, it hat to be optimized, and I had to be able to detect errors and bugs in code written by other people.

I learned C and C++ because I needed it for my projects, and (at that time at least) it was faster than doing it in Java, for instance. I learned Java because it was taught at university. I learned Perl and shell script, because I did a lot of admin work. I learned JavaScript about thirteen years ago, and I had to re-learn it, when things like AJAX emerged, to keep up. I had to learn Python, because I need some form of speedy prototyping language, that has all elements of modern languages and is easy to use. I had to learn many other languages of smaller significance, for use with other software, predominantly Lua here. To be honest though, those languages in the last sector are different. I had to be quite prolific in the languages I stated above, but those in the group I mentioned last, are more of a necessity, that had to be undertaken, and I kind never learned the languages, but just got them to know, so I was able to work with them, but I never had deep insight in it.

Looking back, learning new languages was never really my decision, I just had to do it. right now, I concentrate on C and Python.

As you may have noticed, there is not one web programming language, like Ruby or PHP. What can I say, I'm not a web developer, I just never had to learn one of them! :)

share|improve this answer
Actually, I do a little PHP programming from time to time, but it falls in the category, of "languages I know". – polemon Mar 17 '11 at 8:19
+1 for emphasizing the difference between knowing and mastering a language. – Péter Török Mar 17 '11 at 9:20

I can't speak for others, but I try to learn a new language every year or so just to keep the mental muscles exercised. (I'm actually a little behind on that — but my most recent language was Haskell, and it's still bending my brain on a regular basis.)

share|improve this answer
One year seems very short to me to , what I called, "learn a language" ... – Pierre Mar 17 '11 at 9:48
I'm a fast learner, and for me the best way to learn a language is to use it. (One of the reasons I'm still stuck on Haskell was that I failed to find a good reason to use it at work; now that I have time, I'm fixing that by hacking on XMonad.) And keeping that "fast learner" now that I'm in my upper 40s is why I keep pushing myself. – geekosaur Mar 17 '11 at 16:59
@geekosaur: I managed to find a small project to do in Haskell at work even though our main language is C++. Finding a larger project to do in Haskell is harder though, especially if it is not the main language used by your company. – Giorgio May 20 '12 at 13:15

Once I read about any new language with at least one new and interesting feature I go and "learn" it. In most cases it won't be anything more than reading a language specification, if there is one, or jotting a couple of little programs.

It is really, really rare that a language is introducing a truly new concept, so it won't take more than an hour to learn everything you have to know about any new language. If a language is new and interesting, I learn it by implementing its compiler.

And, of course, languages that does not introduce anything new (i.e., a vast majority of them) does not worth learning at all - you can simply start using them straight away, of course if you're forced to do it.

share|improve this answer
In your opinion, what would be a set of programming languages which covers all the interesting features? So if I decide to learn every interesting feature I will only need to learn this small set of languages. – Max Oct 6 '12 at 12:31
@Max, as I said in my answer, it does not take much time to skim through a language which does not add anything new. For me the most feature-dense languages are Forth and PostScript, Common Lisp and Scheme, Haskell, Erlang, Oberon-2 and C, APL and J, Prolog and Mercury, LabView, Mathematica and Axiom, C++11, Smalltalk. They'll cover most of the functionality space, but of course there will be some interesting and important gaps missed in this list. – SK-logic Oct 8 '12 at 8:11
Thanks, that looks very much like the list-of-languages-to-learn that I have :) When you say "language A and B" do you mean that it's enough to study one of them? I thought that studying common lisp over scheme would be enough to get all the ideas of the "lisp family" languages. Do you list APL and J because they are array-based programming languages? Don't you think that functional programming is a superset of array-based programming? Do you think that APL and J have some ideas which are not covered by, say, Mathematica and MATLAB? – Max Oct 8 '12 at 8:50
@Max, "language A and B" means they're complimentary (should be studied in parallel). I.e., CL and Scheme will give two opposite approaches to the macro metaprogramming, Mathematica and Axiom are opposite approaches to the term rewriting (dynamic vs. static typing), etc. APL and J are examples of a point-free style (concatenative programming), same as FP, for example. Of course you can enjoy this style in any functional language, but it worth learning a language where this style is enforced. – SK-logic Oct 8 '12 at 9:45

I started to invest a lot of time to a different environment when I decided to change career path. Many application domains are tied to specific languages so I changed based on where I wanted to go.

Examples: Finance (usage of java/.net/c++). Modern web applications (Ruby/Rails/etc). Would you want to program in Android without knowing Java?

share|improve this answer

When you start getting bored with the current languages you know then it's probably time to learn bits and pieces of another one but sometimes you learn out of necessity which usually tends to be the best way to learn a new language.

share|improve this answer

I decide the moment I see/read some code or feature that makes me go "wow that's cool".

share|improve this answer

Since you mentioned move, I'd say if you need to:

  • get/keep a job
  • change platforms (desktop, mobile, web)
  • operating system change (depends on current language)
  • find some task that former language can't handle

I understand wanting to grow and avoid boredom by picking up a new language, but I'm not sure those are strong reasons to move; more like add.

share|improve this answer

The reasons for trying new programming languages are vast, as everyone has more than one reason to do it. I personally have a core set of languages I use regularly: Java, C#, Ruby, HTML/CSS/Javascript, SQL. I cut my teeth on C++, but haven't needed it in any of my projects for over a decade now.

So some of the reasons I've had to try new languages are:

  • I wanted to find out what the fuss was about: Erlang, Smalltalk, Ruby
  • There were frameworks/tools I wanted to try: Java, Ruby
  • I needed it for my day job: Java, C++, C#, SQL, HTML/CSS/Javascript

With each of these languages I always started with a small project, to learn how to get things done. Then I expanded that knowledge as I had need. In the process of learning these languages, I learned about different thresholds of understanding:

  1. Basic syntax, hackery. You can make things work, but it still smells like the other languages you've used.
  2. Understanding concepts. You understand what makes the language unique and incorporate that into your code.
  3. Proficient. You can work on large and complex projects with the language.
  4. The mythical mastery. Your understanding of the language and its libraries are deep enough to explain the memory model, execution model, security model, etc.

The only language I've experimented with that I didn't get past the first step was LISP. I just wasn't interested enough, although I may get back to trying it out again one of these days. Almost all the other languages I've played with I've gotten at least to level 2. That's when you can apply the approaches in one language to another. In order to get to level three, you need to work on something more complicated. However, I found that I can get there within a month on any new object oriented language because I've already learned the core concepts. If I were to pick up LISP, Haskell, or something completely different I imagine it would take me at least a month of concerted effort to start to grasp the new concepts, and then another 3-4 weeks to become proficient in it.

The suite of languages I have right now is sufficient for a while, but I'm a curious person. I like language design, and I want to continue to learn how to solve problems in new and better ways. I'm sure I'll learn more, but the next language might not be object oriented.

share|improve this answer

I've been paid to program in seven different languages, have written significant amounts of software in probably another seven to ten additional languages in personal, open source, and educational settings, and can read and understand the gist of several other languages even though I've never written anything more than hello world in them. Obviously, I'm a little biased toward the as-many-languages-as-possible end of the spectrum, even though the vast majority of my daily work is in C++.

My theory is you should know enough about other languages to be able to know if it would be better suited for any particular task, and why, and be able to recognize the language and follow the code without getting completely lost when you see it. This can usually be accomplished by spending a few hours running through a tutorial, followed by the occasional refresh reading a StackOverflow question or online article. That way, if a different kind of task comes across your desk, you can use the best suited language for it. You should also know the idiomatic ways of doing things in that language, even if you have to get a lot of help with the syntax when you start actually using it.

For example, even though C++ is my "native" language, I know better than to use it for web programming, and am familiar enough with other languages to choose one better suited. Also, even though features like closures aren't available (yet) for C++, I still know enough about them to use them where they make sense when writing javascript code, so my code is more idiomatic rather than looking like transcribed C++.

share|improve this answer

First, I will use "a new programming language plus an included framework".

Altought, its impossible to learn every new programming language (and framework), and instantly recode an entire application, its good to have one or two "backup" languages, for "fun and profit".

I lost my .NET job once, and there where too many developers in my area, at a given time. And it happen that I already learnt PHP for my custom toy web page / blog. And, got a PHP job that pay for my bills (food, car gas, rent, phone, cheeseburguers for the cat) for 2 years.

Learning a new language (framework), its also good for your solving problems skills. Sometimes, you learn something in the hobby language, and later, apply it to the job language.

And, I insist. Think about "Programming Frameworks", not just "Programming Languages", unless very specific syntax questions. We no longer code in a terminal.

share|improve this answer

When I'm feeling too comfortable with what I already know, it's time to learn something new.

share|improve this answer

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