Worthwhile programming languages

18 August 2010
At the end of the day, there is only one group of languages companies care about: Ones you have used commercially. As a postgraduate student I got more emails about 3+ year old C#.NET experience than I did about 3+ years of active C programming. However in my line of work I have a lot of leeway in what language I use for my work. So obvious question: What language(s) should I use, even if just for future CV purposes..

Programming language popularity

Unlike most listing of programming language popularity, Tiobe both covers a long period of time and is fairly easy to digest. I am not sure what caused all the bucking of the trends in 2004, but from the UK perspective it is consistent with the aftershocks of the dot-com crash. Around this time a lot of companies took IT operations in-house and hence software engineering contractors all being out of work. Some specific remarks:
C vs. C++
C++ took a big hit 5 years ago, and has (almost) flatlined ever since. In contrast C seems to have something of a renaissance.
VB & C#
Before I saw these figures I assumed that VB was losing popularity straight to C#. Not going to read much into these two, as I do not use either of them these days. Surprised me as I thought there would be a general trend from C to C++..
Java in decline
Raw figures are Java losing about a quarter of popularity in the last 8 years (i.e. 1 percentage point per year). A manager at a Bloomberg recruitment event a few years ago was somewhat dismissive of the technical knowledge of Java programmers, and I personally am not that fond of it. I nevertheless still find it a bit surprising, as Java jobs seems to still be very common.
Perl the next COBOL?
Perl is clearly in decline, with popularity halving in 4 years (like Java, one percentage pointer pet year). However I have noticed that it seems to have a rather loyal following among the more established web-based outfits I have crossed paths with this year.

What about C++

On paper C++ is a good idea. Lots of companies I might consider applying to use it, and I can build upon my somewhat extensive C experience. In practice I always end up going back to C. Both C and C++ require a lot of underlying knowledge to use properly, and in the case of C I actually know what is going on. Properly adopting C++ means object-orientated programming, which means abandoning all the dodgy pointer-based speeds-ups I do all the time in C. If i'm doing that, I may as well admit that raw speed is not a concern and switch to a language that includes garbage collection.

There is one plus point. There are only two decent C-based GUI APIs, and both of them (Win32 and GTK) have specific issues (Win32 is Windows-only, and GTK's GPL is awkward for embedded devices). That might be enough motivation to make the switch from C to C++..

What about speed?

C being popular has more to do with having a small storage footprint, rather than any real CPU limitations. C++ can also have a small footprint, but the standard C++ libraries do have a bit of a reputation for bloat. I did some speed-testing of Java Hotspot (and non-hotspot) versus GCJ machine-code output, and the dynamic recompilation in Java Hotpot makes it surprisingly fast.

So the choice is..

C is what I have used for 15 years, it fits what I do quite well, and it seems to be gaining popularity back from C++. As a secondary language (mostly intended for prototyping) I use Python, as it provides both object-orientation, and is a cleaner scripting language than Perl. Given that it is better to consolidate on 1 or 2 main languages, C and Python seem to provide the best spread of features.

What about 'side' languages

Although not planned, I have ended up doing some SQL (I was only person who had any idea of database languages) and Bash shell-scripting (since unlike Perl, /bin/bash is an existing system dependency) has also slipped in.

..and finally

If you are still a student and hence have IEEE Explore access, an interesting read is Chen et al: An empirical study of programming language trends. Although a bit dated, covering 1993-2003 (their predictive modelling for 2004-2008 is somewhat amusing with benefit of hindsight), it does confirm what I had suspect was happening with Computer Science courses: Compiled languages through the floor and interpreted languages through the roof. Interesting that while C/C++ are the only languages that have currency in electrical engineering, they are increasingly becoming a pesky-first-year stuff in computer science. For the industry I do not regard this as a good thing.