Several people have asked me recently about what language they should learn first. This article is intended to be a single point of reference for all those conversations, as well as sparking input from other people who know about the subject.
My answer is usually:
- Salary differences between languages are small enough that you should care more about other aspects of the process (e.g. if the boot camp makes guarantees about you getting a job) more than the specific language, but
- Front-end (developing things that the user sees) pays less than backend
- Keep standard 80,000 Hours advice in mind, like that it's better to explore many options in the beginning of your career than optimize for just one
More Detail
Below is a table of programming language popularity (taken from TIOBE) along with data from two salary surveys. You can see that the variance within one language across the different surveys is about the same as the difference across languages within one survey (119 vs. 131/76), which indicates that geographic factors, company size/type, years of experience etc. are probably more of a concern than the specific language. This fits with my anecdotal experience.
The argument for backend development is mostly due to oversupply of front-end developers: there are a lot of graphic designers, artists etc. who learn a little bit of HTML and JavaScript so that they can get a job doing front-end. There’s also some evidence that backend developers get paid more.
The second programming language you learn will be vastly easier than the first, and most developers will switch between languages throughout their career, so you should not feel that this first choice is locking you in.
I've bolded the ones which are most commonly taught as a "first language".
Popularity Rank | Programming Language | Relative popularity | Average salary (Compass survey) (in $thousands) | Average salary (Quartz survey) (in $thousands) |
1 | C | 16.64% | 100 | 90 |
2 | Java | 15.58% | 90 | 95 |
3 | Objective-C | 6.69% | 108 | |
4 | C++ | 6.64% | 110 | 94 |
5 | C# | 4.92% | 92 | 89 |
6 | PHP | 4.00% | 76 | |
7 | JavaScript | 3.63% | 78 | 91 |
8 | Python | 2.61% | 102 | 101 |
9 | Visual Basic .NET | 2.33% | ||
10 | Visual Basic | 1.95% | 86 | |
11 | F# | 1.51% | ||
12 | Perl | 1.33% | 82 | |
13 | Delphi/Object Pascal | 1.15% | ||
14 | Transact-SQL | 1.15% | 80 | 86 |
15 | Pascal | 1.09% | ||
16 | ABAP | 1.08% | ||
17 | PL/SQL | 1.03% | 80 | 86 |
18 | Ruby | 1.03% | 90 | 109 |
19 | MATLAB | 1.00% | ||
20 | R | 0.95% | 90 |
This is all going to be purely anecdotal, of course (and note that I am not in a tech hub or even any city, to my great unhappiness): I started out with Ruby, and I feel like I came in during "peak Rails". Trying to find another Rails job is extremely challenging because of the huge glut of beginner-intermediate Rails developers, and it has gone mainstream enough that it's not really a useful signal of whether it's an employer that's worth your time. I think Ruby's future is basically that of Java. Actually, I'm slightly more optimistic about Java.
If I were starting all over from scratch today, AND if I had a friend or mentor that could help me with questions when I was stuck, I'd go straight for Clojure. The Clojure community is still very small, but really excited about newcomers. The reason I mention the necessity of some kind of mentor is that Clojure, as opposed to Ruby or Javascript, still has so many beginner pains that it really helps to have someone steer you in the right direction (Clojure errors are notoriously unhelpful and it doesn't just work "out of the box" like Rails does). The Clojure groups are all small enough that you can join in and not be lost, but there seems to be vastly more Clojure dev positions than people to fill them. These aren't jobs you'll find listed on StackOverflow or LinkedIn - they're passed around through word of mouth. But if you are a respectful community member, people seem overwhelmingly happy to help you. (Note that I haven't been able to land one of these Clojure jobs yet, but I imagine a more talented programmer than me would be able to do so quite quickly.)
I imagine there are other languages like Clojure, that are small but full of opportunity. I'm just not part of them, so I can't comment on what's there. Scala seems like it might be similar.
Take this with a grain of salt, as I don't have access to any sort of real-life programming community. This has just been my experience with my interactions online. As others have said, bootcamps are an appealing option if that's something that's available to you.
Traditionally languages like Clojure are learned by experienced programmers who have high intrinsic interest in the act of programming itself, so I expect the people you compete against for Clojure jobs to be pretty skilled, and employers may also have a high hiring bar. But if what you say is true it does sound better than Ruby/Rails.