Should you really learn another language?
Blogger Gustavo Duarte cursed in church when he said that learning new programming languages is often a waste of time. He initially called his post, “New Languages Considered Harmful”, a wordplay on Dijksta’s classic paper on gotos, but after the reactions he got, he toned it down a bit and it’s now called ”Language Dabbling Considered Wasteful”.
Learning new programming languages is often a waste of time for professional programmers. It may be a fun waste of time (i.e., a hobby), but it’s a waste nonetheless. If you do it for pleasure, then great, but profit is scarce. Pointing this out among good programmers is heresy: even the pragmatic programmers, whose teachings are by and large excellent, suggest we should learn one new programming language every year. That’s rubbish.
He also explains why he thinks it isn’t useful, by saying:
The theory is that by learning a new language you “expand your mind” and become “a better programmer”. Right. By that kind of argument we should all be eating LSD (don’t). In reality learning a new language is a gritty business in which most of the effort is spent on low-value tasks with poor return on time invested.
Gustavo criticizes Scott Hanselman’s analogy that learning new languages is like sharpening the saw. Scott said:
This year, I’m learning Ruby. Does that mean my team is moving to Ruby? Probably not, but it does mean I’m learning Ruby this year because I believe in sharpening the saw. You might be too busy sawing to sharpen, but I’d encourage you - no matter what brand or type of saw you use - to remember that there are other folks out there cutting wood successfully with a different kind of saw. Maybe they know something that you don’t.
Gustavo doesn’t believe that’s the way it works out.
Scott Hanselman argues that learning a new language is sharpening your saw, but I see it as neglecting your half-sharpened saw while playing with the dull, new, shiny one. The upfront cost is not the only one either. It’s better to have 3 razor-sharp saws than 8 so-so ones. Each new language you add to your toolbox is making it harder for you to become furiously productive in any given language.
That spawned off discussions all over the web.
I think he’s operating with the assumption that all languages have the same concepts, just with different “lexical and syntactical bureaucracy.” But I think the point of the advice to learn more programming languages is to expose yourself to different programming paradigms. And in order to do this, I don’t think you need to become an expert in the nuances of that language, but you need to become comfortable in thinking in new ways.
Steven Hazel continues:
I think “enough” is a crucial point here. The author almost seemed to be arguing against switching to a new language every year, which I agree is ridiculous. The idea is to learn some new concepts, not to write significant programs in a new language every year. I only adopt new languages for regular work if they’re the pragmatic choice.
Alain Perils’ stated in the classic Epigrams on Programming that “A language that doesn’t affect the way you think about programming, is not worth knowing.”, which goes well with Eric Raymond’s finding:
Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.
That quote is what starts off Paul Graham’s famous article “Beating the averages” where he introduces “The Blub Paradox”. From the article:
After a certain age, programmers rarely switch languages voluntarily. Whatever language people happen to be used to, they tend to consider just good enough.
The Blub Paradox is about the theory that everyone knows why they chose their language(s) of preference, most often since it’s so powerful. They chose C over machine language for the programmer productivity, or maybe Java over C for the abstractions and thereby the programmer productivity. There are of course other languages they hear about but they think “There is no problem I can’t solve in my language, I see no reason to learn another language”.
The programming languages, or rather language types, you understand (not necessary is most fluent in), tends to steer your thinking. According to natural language researchers, if there is a word missing (or a category of words) from a language, people have a hard time thinking about the concepts that the missing words represents. Paul Graham states approximately the same thing about programming languages.
Programs that write programs? When would you ever want to do that? Not very often, if you think in Cobol. All the time, if you think in Lisp.
So, should you spend time learning new languages or not? And if you decide you should, how do you choose your next language to get maximum effect?
Peter Norvig, Director of Research at Google, wrote an article called Teach Yourself Programming in Ten Years where he gave explicit advice on how to choose languages to learn:
Learn at least a half dozen programming languages. Include one language that supports class abstractions (like Java or C++), one that supports functional abstraction (like Lisp or ML), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), one that supports coroutines (like Icon or Scheme), and one that supports parallelism (like Sisal).
So, what’s your opinion? Will you be learning new languages or is it a waste of your time?
What seemed to be for pleasure turned out to be for profit...
I can only speak for myself, but trying out a new language every now and then has helped me tremendously in my professional work. Different projects allow for different paradigms and I firmly believe I have saved myself and customers from a lot of unnecessary work.
For me there is an obvious connection between the grammar of a language and how you can think of a problem domain.
Nothing wrong with learning new languages
Far too often, I run into developers who think that "growing" as a software developer means learning new languages. Baloney. My personal opinion: a coder really only becomes a software developer when technology ceases to be the primary motivation for work. Software development is about solving problems for users. No user ever bought something because it was written in Lisp.
That said, if learning a new language shakes a little calcium out of the cranium, cool.
Orthogonal language set
Thanks for this post, you did a great job of capturing the discussion and the relevant arguments on either side. The only comments I missed were Thomas Ptacek's comments from YNews. He's enormously talented and captured the argument well in a couple of lines.
Much of what I was criticizing is what Bruce Rennie mentioned in his comment. In general, I think learning new languages is overrated, that's basically it. There are a lot of other things with much better learning per time invested imho.
But I do agree with Norvig on this one, namely that you should learn a set of orthogonal languages, although I think there's more to orthogonality than just the type of abstractions. My ideas on the right set are pretty different, with Lisp being about the only common language with his, but the spirit is the same. Pick the smallest orthogonal set, stick to it, and get really freaking good with it, that's my take.
It could be a waste
Yes, for me learning a new language, over the above mentioned two, for the sake of it can be fun but a waste of time. It is like natural languages: you can say stupid things in seven different languages or say intelligent things in just one. Better improve design and architectural knowledge, or learn a component model like Spring, EJB, SCA instead of new syntaxes, IMHO.
I however agree that learning a complete different language, based on a different paradigma, say Lisp for example, can lead to think differently while solving specific problems. It is hard to generalize, however.
There is a certain level of madness
How does that community deal with documentation, creating and distributing libraries, bugs, patchs, etc....? All the problems that are universal to the process of software development.
Languages these days are as much about the community around them as the actual technical features of the language. It's worth learning Ruby simply so you can understand the context for Matz's emails on the Ruby Development list.
There are other ways to get around the routine trap, but learning a new language is relatively easy to start/stop and you get a significant benefit without a lot of investment in time. I think most people don't need practice per se, but motivation.
_ Booker C. Bense
I don't know about just languages.
However I do question that value of learning a new language out right, it's always good to see how the other side lives though. It kind of seems redundant after a while, imperative programming is the same in every language, they syntax changes a bit but that's not much to learn. Functional programming is functional programming. Logic programming is logic programming. I'm not sure what causes the languagism. It can be fun and at times I'm sure you can learn some new things that benefit you elsewhere but I'm not sure what the real value is and I think after a while you get less and less out of the exercise.
I also question what it means to learn a new language. Is it when you're familiar with the syntax and can bang out some simple programming 101 problems? Any more, the language seems to be minor compared to knowing some of the community and the trends within that community and that takes more effort to acquaint one's self with. That knowledge doesn't always seem to be readily available in book form either, you have to invest some time, do some research and go find it. Simply learning Ruby isn't terribly interesting until you learn gems, rake, rails and some other things that are all really outside of ruby itself. Same with Java, it's pretty easy to get familiar with java but when you hire a java developer you want someone that knows Spring, JBoss, Glassfish, and struts (or some other list of frameworks) In my mind, that substantially raises the benchmark. Once you kind of penetrate that "community" (for lack of a better word) it's harder to leave your language to learn another, even if just as a hobby. There are other things outside the language that matter, when I think of a C or C++ programmer, I think of someone that knows how the OS interacts with a program and how a machine's memory is laid out, not someone that can write some algorithms in C or C++, concepts that are largely unfamiliar to someone that knows just java and ruby.
The tooling of a given language or technology also seems more important than in years past. Writing C# in Visual Studio is a different kind of thing than doing it in vi. It can radically change the experience and it also can dramatically increase the learning curve. It's also kind of the opposite of what Pragmatic Programmer says to "use a single editor," while I think you should be master at at least one, being able to learn and use many is good too. Programming Java with Idea is a very different thing than doing it in just emacs.
With some of the extras, I don't think it's possible to learn some languages in a year as just a side project. Maybe greater still, languages like Erlang and Ada were developed with some specific problems in mind, do you really get much of an appreciation for them without understanding those problems? If you factor all of the extras in, learning more languages is a great thing.
Martin Thompson Jul 27, 2014