Thursday, 26 December 2013

Which programming language to learn next

This is a revamp of an earlier post that started with my personal path of finding a language I'd like to master in 2014. After lots of discussion on different forums I've come to a nicer, and higher level view of this question that puts it in a different perspective. My hope is that this approach is more useful for the reader.
There is a common wisdom that a programmer should learn a new programming language every year. I think that would be too much and after a certain number one wouldn't benefit much from the next language. I agree in that one should know several different languages in order to see different ways of expressing and solving problems and to use that experience in their working environment. "Several" is not a specific number, but it is not less than 3 and not more than 7. Probably a wisely chosen five languages should be enough. Here is a way to group the languages that I believe can help in the process.

The basics

C or C++ with a touch of Assembly. Without these you will struggle to see and understand what's happening in the background when you use a higher level language in the future. You don't need to be proficient in any of these, but you should get to the level where you understand what happens on the stack during a function call and you can implement the basic data structures and algorithms with some performance constraints. On this level you are forced to think about the efficiency and this understanding comes handy in the future when a mere decision between HashSet and List will makes or breaks the efficiency of your code.

An OO language

C++, C#, Java. Pick one, master it. Learn the platform not just the language. Learn and apply the OO principles.

JavaScript

This one is not a for learning new concepts. If you really want to avoid it then you can. But it's definitely worth to familiarise with it: besides being the C of Internet it is the chosen language for cross-platform mobile development and you can program server-side (nodejs) or Windows 8 desktop apps in it as well. Sooner or later during your career it will catch you :)

A scripting language

Python is an obvious choice here, Ruby is another one. Perl, shell script and probably some dozen others are also on this list.

A functional language

Haskell, F# or Erlang. Haskell is THE language to learn if you want to master the functional programming principles. If, however, you plan to use the language for work then you are better of with F#. And there is Erlang somewhere in between.

One from the Lisp family

This level is mostly academic (except if you are working with AI) but I am sure one still can benefit enough from this. The problem is that the Lisp community is very fragmented (and Lisp syntax is (very (very)) strange). There are two major dialects and several minor languages. Today I would recommend Clojure: it targets the JVM and compiles to JavaScript. Both are such benefits that move the language to the "actually useful" field.

How to choose

If you want to choose your one language then you are reading the wrong blog. So you want to choose your nth programming language. First of all you should choose one that you like: you like the community, you like the company that controls the platform, you like the syntax, the libraries, the frameworks and the tools. One should not learn a language that they don't enjoy using. My second advice is: diversify. Choose from a group above that you have no experience with yet. My next one is Haskell.