This post is mainly targeted at HN readers who are good at programming but are not professional software engineers, with a focus on academics and aspiring academics. I know there are plenty of us here.
Say you were exceptionally smart as a kid and dreamed of being the next Einstein, Gauss, etc. You went to a top college, by which point you should have realized that you're not really a child prodigy, but you're still among the brightest. Then you went onto a top grad school (in a non-CS field), by which point you realize you're now competing with equally smart people, and there are bound to be losers.
Meanwhile, you discovered programming at a young age and love it. By the time of your grad school career, you've been programming for north of a decade and you're pretty decent, but don't have flashy projects to show for since you've been focusing on your main academic area for the most part.
However, you have software engineer friends/acquaintances who started programming only in college, who are probably less technically capable and less passionate, who nevertheless got into FAANG or similarly well-compensated companies right out of college, pulling in six figures right off the bat.
You? Your grad school stipend is peanuts, and in a crowded field you're looking at multiple terms of postdoc even if you're modestly successful. You're nowhere near any achievement you dreamed of, the future is unclear and probably unexciting (statistically speaking), and your paycheck sucks. It's hard not to feel jealous, especially when research is going nowhere.
So, how do you deal with this? I'm interested in perspectives from both people who stayed in academia, and people who left. Other comments and observations are of course also welcome.
Some of my best friends stayed in and are now postdocs (I left the PhD with the consolation master).
I'm in Europe so the difference in compensation is nowhere near as big (tech pays less here and grad school pays more) but really it's about what you want to do.
If the compensation is the most important thing then you won't be happy in grad school, equally if the research isn't fulfilling you then you might as well work in industry and earn more.
My friends who are happy in research are those who are working on things they really love (in High Energy Physics etc.) and wouldn't exchange it for the higher salaries (and less freedom) of industry.
For me, it wasn't the pay that turned me off academia but the insecurity - you can study it for years just to be cast out of the field when you can't get a permanent position and in the meantime you continually have to move which makes serious relationships very difficult.
Basically it's a compromise - I think I made the right choice, but perhaps had I better chosen my field in grad school (maybe if I had stayed in Phyiscs?) I would have preferred to stay - I certainly wouldn't say industry is always better.