Programmers are paid surprisingly well given how much work it is to become one. Here's Dan Luu comparing it to other high-paid careers:

If you look at law, you have to win the prestige lottery and get into a top school, which will cost hundreds of thousands of dollars. Then you have to win the grades lottery and get good enough grades to get into a top firm. And then you have to continue winning tournaments to avoid getting kicked out, which requires sacrificing any semblance of a personal life. Consulting, investment banking, etc., are similar. Compensation appears to be proportional to the level of sacrifice (e.g., investment bankers are paid better, but work even longer hours than lawyers). Medicine seems to be a bit better from the sacrifice standpoint because there's a cartel which limits entry into the field, but the combination of medical school and residency is still incredibly brutal compared to most jobs at places like Facebook and Google.

My sister is currently a second-year medical resident, and "incredibly brutal compared..." feels like a understatement to me. She works 80hr weeks, often nights, helping people with deeply personal and painful issues that are hard to leave behind when you go home. This is after four years in medical school, with still at least a year to go before starting to earn doctor-level money. When I compare it to how I started programming right out of college, making more money for 40hr weeks and no on-call, I feel embarrassed.

What makes me nervous, though, is that we don't really understand why programmers are paid this well, and especially why this has persisted. People have a bunch of guesses:

Demand: as software eats the world there are far more profitable things for programmers to do than people to do them.

Supply: it's hard to train people to be programmers, fewer people are suited for it than expected, and bootcamps haven't worked out as well as we'd hoped.

Startups: big companies need to compete with programmers choosing to go off and start companies, which is harder to do in many fields.

Novelty: the field is relatively new, and something about new fields leads to higher profits and higher pay, maybe via competition not being mature yet?

Something else: I'd be curious if people have other thoughts—leave comments!

Things are pretty good now, and seem to have gotten even better since Dan's 2015 post , but something could change. Given how poorly we understand this, and the wide range of ways the future might be different, I think we should treat collapse as a real possibility: not something that will definitely happen, or that's going to happen on any certain timescale, but something likely enough prepare against.

Specifically, I'd recommend living on a small portion of your income and saving a multiple of your living expenses. It's far more painful to cut expenses back than it is to keep them from growing, and the more years of expenses you have saved the better a position you'll be in. If you take this approach and there's no bust, you're still in a good place: you can retire early or support things you believe in.

If being laid off and unable to find similarly high-paying work would be a disaster, figure out what you need to change so that it wouldn't be.

(This isn't really specific to programming, but I think the chances of a bust are higher in programming than in more mature fields.)