Hide table of contents

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:

  1. 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
  2. Front-end (developing things that the user sees) pays less than backend
  3. 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

5

0
0

Reactions

0
0
Comments14
Sorted by Click to highlight new comments since: Today at 6:05 PM

I'd like to add some more information to this.

  1. As mentioned, front-end coders are in less demand and are paid less. There's a very good reason for this... it is MUCH easier to learn. It's best to pick up design ability as well as coding ability if you want to earn-to-give through front-end.

  2. Some of the last languages on the list are for data science programming. While there's crossover applicability of these to regular programming, they are, for the most part, easier to learn and with some great salaries themselves. There's also great demand for data scientists. So don't dismiss R because it's 20th most popular... that also means that there isn't enough supply, and it has the benefit of being relatively easy to learn.

  3. I recommend looking at the momentum of languages as well. One example of positive momentum is Javascript; a number of JS-based frameworks are becoming popular, and it is becoming more and more used for front-end, back-end, and all other aspects of web dev. Python is one that's becoming learned initially more because of its versatility; it's used for web dev as well as data science.

Matt Gibb sent around the following on the 80k alumni list, and said I could pass it on - thought people reading this post might be interested: "A couple of people have asked for recommendations on the quickest way to learn. I have a limited perspective, but I have spent the last 8 years developing, have attended one bootcamp (Insight Data Science), which was per unit time the single most valuable educational experience I have ever had, and I have been able to visit many of the top bootcamps in the Bay: HackReactor, AppAcademy, Hackbright, Makersquare etc. I know many of the founders personally and/or have taken investment from them. Anyway, here's my 2 cents that I believe will be helpful, based on what I have seen work. Take it with a hefty pinch of salt.

  • If you are going to learn one web development language, learn Javascript. It is hacky, but it is the only browser language (ignoring clojurescript, scala.js etc. which you might consider tackling much later), you can cobble together the whole stack in it: frontend, backend (node, meteor, sails.js), database (mongo, rethinkdb, firebase). HackReactor have a JS-only syllabus, and are one of the top schools in the world.
  • If you are going to learn one sql database, learn Postgres.
  • If you are going to learn one frontend framework, learn React.js. Angular's source code and design are a bit messy and you will ship a faster, more reliable product with React. With React Native, you will soon be able to deliver iOS and Android apps in too.
  • If you are going to learn one data/machine learning language, learn Python (numpy, scipy, pandas, scikit-learn).

After the above:

I have found codeschool.com really helpful, but I know there are many other great resources out there which I haven't played with.

I would recommend going to a (well-regarded) bootcamp over self study, because you will make progress at about 3 times the rate for a few reasons:

  • The courses are designed to focus aggressively on the most important/high ROI things to learn. When I was getting started, I found I would just be diffusing through this unknown space of related technologies with little idea what was most important, and ending up learning a load of unimportant trivia along the way.
  • You will end up stuck on a missing semicolon or closing bracket for 10 minutes, not 2 days.
  • You will be surrounded by smart, determined people that will push you to be your best and give you valuable solicited (and unsolicited!) feedback
  • Every day you will be immersed in creative ideas and evolving products that will influence your own
  • You can ask any question you can imagine and almost certainly get an informed answer quickly

For example to automatically test a batch of solar cells on performance, match supply and demand on the electricity grid, help a doctor find a tumor in an MRI image, process a lot of money traffic. These things do not typically happen on a consumer website.

Learning to code will allow you to do all these things. Coincidentally, part of my PhD was in in image segmentation/registration, I am building a real-time Dutch auction now to drive down costs for students, and the solutions/skills required are much closer to web dev than you might think. Don't worry just get started :)"

Some additional factors people may want to consider:

1.) How enjoyable it is to program in that language, since you'll probably be doing it a lot. (Programming in Java is generally not fun.)

2.) How good the resources are for learning that language. (Ruby seems to be the best on this metric.)

3.) What the companies that use each language are like. (My guess is few SF start-ups are programming in .NET these days.)

As someone currently in the process of learning programming here are a few thoughts on my attempt at learning two of the bolded languages, Java and Ruby:

I'm currently working through The Odin Project, which has a backend focus on Ruby, and I'd highly recommend it. I'd also recommend Peter's guide to TOP which I've found very useful which includes some time estimates, some additional resources and some things to learn after you complete TOP. Perhaps the biggest plus to TOP for me is giving projects of the correct difficulty at the correct time so that they are challenging but doable. Another of the biggest benefits of TOP is the sheer scope of the resources already collected for you. Also Ruby is far more intuitive than Java.

Before starting TOP I started learning programming by attempting to learn Java on my own without much structure. However, going on my own I'd often spend time attempting to track down a good explanation for topics. There was also the issue of not knowing what was a logical path to take to learning and I think I took some major false steps. The resource I found most beneficial during that time were probably the free courses at Cave of Programming which covered a wide range of topics but had the huge downside of being somewhat dated video tutorials. Other than that I didn't find lots of free resources to help learning Java but there are some pretty cheap stuff on Udemy and a subscription to Lynda could be a good investment as well.

Of course, a huge caveat, I am a sample size of one who had no experience at all with programming before starting with Java. People with different backgrounds may have very different experiences.

Epicodus put their entire Ruby/Rails program online for free here. I don't know enough to judge the quality, but it might be useful.

Regarding the topic of how to learn, I am not such a fan of the online courses relative to simply reading a book or website which lists all a language's syntax, or a long list of functions. If that's enough for you to grasp it, it's certainly faster. Many of the main websites for languages contain these lists.

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.

(off-topic, but I can't find a way to do private messages.)

Trying to find another Rails job is extremely challenging

I started an earn to give company which is hiring rails developers. If interested, can you send a resume to my first initial plus last name @healthefilings.com?

Less Wrong thread. I still advocate learning Python; it's an OK or good choice for almost anything you'd want to program, and I think its simplicity and readability mean that it will give you the best conceptual foundation out of anything out there. I listed a bunch of resources on learning Python in this post. They're a bit deeper and more conceptual than the resources you'll see on learning Ruby, which is a good thing because it will differentiate you from all the Ruby web development types and give you the opportunity of becoming a backend developer, which has higher salaries and barriers to entry (and is a better fit for someone who has more of a traditional math/engineering mind since it's less forgiving of mistakes and has more challenging mathy engineering problems). If you're sure frontend web development is all you want to do or you have some cool frontend thing you're inspired to make, I guess JavaScript is fine.

I have also found Python to be very useful. I learned through Udacity's Intro to Computer Science course, which was really user friendly.

What's the definition of frontend and backend here, which is relevant to earning-to-give potential? If you're writing database-driven Ruby or PHP code which generates HTML, are you a frontend or backend developer in this sense?

in a well-designed system, the presentation layer should be a separate code base from the business logic layer. MVC and other frameworks enforce this. So in theory you should never have one function which both does logical calculations on the database (e.g. validating that data is formatted correctly) and outputs HTML.

It might be that at a small company one person does both the backend and the front-end, in which case I would describe them as a "full stack" developer.

It might be interesting to compare data from other sources regarding popularity. For example, GitHub tells a dramatically different story about programming language usage that may be useful in predicting what these trends in industry will be in the future.

Curated and popular this week
Relevant opportunities