It depends on other things about you that we don’t know. What do you want? What’s your skill/ability profile like?
If you’re most interested in money, working as a salaried programmer can take you into the six figure range (the average for Silicon Valley has passed that now). Your skills will obsolesce faster than in other disciplines, and you’ll actually be called on it (doctors skills vary a lot by time of graduation, with older being worse, but the patients don’t do anything about it), but that’s manageable. Unfortunately, as you get older you lose fluid intelligence and so can’t learn new skills as easily.
You can make much more money in startups in expectation (from tail outcomes) if you’re good, but note that one can be an entrepreneur in other fields (software/web startups are nice in terms of low barriers to entry, low capital requirements, etc, but that also means more competition). With a long time horizon if you’re smart enough to reliably graduate medical school and find medicine tolerable you’ll make more money as a doctor than an engineer. Likewise for elite law schools, if you both have the credentials to get in and go to the high end places (although that carries more risk). Finance (investment banking, hedge funds, etc) has substantially better financial prospects if you can get into it, although again nontrivial risk.
Other technically demanding jobs (other types of engineering, actuaries, etc) have similar or better aggregate compensation statistics.
In terms of quality of life, some people really like coding, at least compared to the demands of higher-paying fields (risk, self-motivation, management/sales/schmoozing, intense hours, many years of costly schooling, etc). Others don’t.
It depends on other things about you that we don’t know. What do you want? What’s your skill/ability profile like?
If you’re most interested in money, working as a salaried programmer can take you into the six figure range (the average for Silicon Valley has passed that now). Your skills will obsolesce faster than in other disciplines, and you’ll actually be called on it (doctors skills vary a lot by time of graduation, with older being worse, but the patients don’t do anything about it), but that’s manageable. Unfortunately, as you get older you lose fluid intelligence and so can’t learn new skills as easily.
You can make much more money in startups in expectation (from tail outcomes) if you’re good, but note that one can be an entrepreneur in other fields (software/web startups are nice in terms of low barriers to entry, low capital requirements, etc, but that also means more competition). With a long time horizon if you’re smart enough to reliably graduate medical school and find medicine tolerable you’ll make more money as a doctor than an engineer. Likewise for elite law schools, if you both have the credentials to get in and go to the high end places (although that carries more risk). Finance (investment banking, hedge funds, etc) has substantially better financial prospects if you can get into it, although again nontrivial risk.
Other technically demanding jobs (other types of engineering, actuaries, etc) have similar or better aggregate compensation statistics.
In terms of quality of life, some people really like coding, at least compared to the demands of higher-paying fields (risk, self-motivation, management/sales/schmoozing, intense hours, many years of costly schooling, etc). Others don’t.