Which programming language should I learn in 2015?
Back in 2013, we looked at a brief history of the programming languages that gained traction in various different business domains, the near-hegemony of the C family of languages from the late 1980s, and their evolution into languages like Java, C#, and JavaScript.
We concluded with a look at what drives the (buzzing) node.js community and the popularity of JavaScript, its power and its challenges, along with some predictions about great languages to bet on in a polyglot future - like F# (and, from commenters, R, Matlab and others).
Well, we are now living in that future. Nearly two years later what has changed?
We can start with a look at the Tiobe index for March 2015.
Back in 2013, Javascript had just been pushed out of the top 10 by a resurgence of Ruby, Perl and Python. In 2015 Ruby (and especially Perl) have declined substantially, and JavaScript adoption is up year-on-year, granting it a top 10 position once again.
The top of the chart is still dominated Java and C - although their positions are reversed (C is now number 1), and both have declined slightly relative to the rest of the chart. C-family languages, therefore, still hold over 50% of the share, though all of the top 5 have had their share eroded since 2013. In fact, one of the stories of 2014 is the dramatic decline in the use of Objective-C as developers have looked for cross-platform alternatives when building mobile apps.
However, the most stunning growth has surely come from those languages we tipped in 2013. F# has had amazing adoption, now holding the same number 11 spot on the chart that JavaScript did in 2013, and with a slightly higher percentage share. Matlab and R have both entered the top 20, with almost 1% of the share each.
The most surprising entrant for me, though, is ABAP - SAPs COBOL-family 4GL. COBOL. That's a thing I didn't expect to be writing in 2015. COBOL. Let's take a moment to think about all those SAP developers who are using COBOL.
OK.
What about those languages that might make writing JavaScript more palatable? Last time, I mentioned CoffeeScript and TypeScript. Well, CoffeeScript has made it into the top 100 languages for the first time, which is interesting.
What is probably more interesting is the increased adoption of Typescript features in the JavaScript language itself, and language convergence. TypeScript, as of v1.3/v1.4, is aligned with ECMAScript 6 (ES6), allowing it to become a true superset of the ES6 language.
And, more significantly still, Google and Microsoft have agreed to collaborate and not fragment the JavaScript-family further, by basing Angular 2.0 on a future version of Typescript (v1.5+).
So, with the JavaScript engines adopting new ECMAScript features faster than I expected, and all major browser manufacturers on a faster release cadence (including MS's end-of-life announcement for all non-modern IE versions from next January), I would slightly modify my view of JavaScript's future.
I still hold that JavaScript as we knew it in 2013 is numbered, but the language that succeeds in its place will, likely, be called JavaScript - but its usage patterns will be very different from those we were using in 2013. And in the vanguard of this transition will be Typescript. CoffeeScript may well remain in the top 100, but will not see significantly increased traction.
Now - back to the highly contentious question of what programming language a beginner should learn.
Let's remind myself of the criteria I set (which were not disputed in the commentary last time out - I'd be interested to hear if you think there are other criteria we should apply)
1. A REPL environment
I think this is an absolute prerequisite. I want to be able to type something on the screen, and see the result. Immediately. No messing about with compiling and linking and nonsense.
2. Good library support for popular data structures & algorithms
There should be good implementations of most popular data structures and algorithms. And I should be able to read and understand the source for them.
3. A clean, cruft-free syntax
Ideally, we remove as many of the language warts as possible (like the unnecessary braces of the C-family). The language should be simple, and expressive.
It should be easy to go from something like
let answer = 1 + 1
to
let add x y = x + y
And see self-similarity as we build up the constructs we are using.
4. A good balance of support for OO representations and functional techniques
This is the key challenge for a modern learning language. In my view, it is likely to be a primarily functional language with classes, rather than the other way around.
5. At least one free (as in beer) implementation
Pity the poor student. There shouldn't be a financial penalty for learning a language. I don't care whether it is free as in OSS/GPL/MIT free, or free as in "a zero-cost license in perpetuity". Your politics may vary.
6. A vibrant enthusiast community
There has to be an enthusiastic community around it. In part, this means it has to have some heritage, and a sense of future. People actively working on it in the academic sphere would be a good idea, too. And, ideally, some mainstream commercial use to avoid the accusation that it is just a toy language you are learning.
In 2015, I would add an additional criterion
7. Must be able to run on a Raspberry Pi
It is critical that we democratise our technology, and give the maximum number of people the opportunity to learn to program at a minimum cost. Raspberry Pi does exactly that. For the price of a family visit to the movies, you can have a programmable computer, and you can still buy drinks and snacks to get you through your all-day coding session.
And the winner is...
I think the case for learning F# is even more compelling than it was in 2013. You can use it to learn both functional and object oriented techniques, it has even broader industry support (that number 11 position on the TIOBE index is quite a powerful drive for adoption), and you can run it quite happily on Raspberry Pi.
When you get out into real, polyglot world, you'll have minimum impedance if you pivot towards any of C#, C, Java or JavaScript - or indeed most of the other languages in the top 20. And, if you happen to find yourself an F# job, it is likely to be well remunerated and rather interesting.
Average salaries for developers, March 2015, in GBP
F# | C | C# | C++ | Objective-C | Java | PHP | JavaScript | Python | VB |
---|---|---|---|---|---|---|---|---|---|
£55,000 | £43,000 | £42,500 | £45,000 | £47,500 | £50,000 | £38,000 | £42,000 | £50,000 | £37,500 |
Source: ITJobsWatch
If you want to learn more about F#, then take a look at F#.org
End note
I've written this post as a part of the UK's National Apprenticeship Week - to try to encourage people to get started with technical (especially software-based) apprenticeships. See #naw2015 on Twitter for more apprenticeship opportunities.