This is outdated advice. If you want to get paid, get a hammer.
In that analogy it also works that in that the level of cognitive difficulty is most challenging @ physics theoretical work --> engineering --> software. Inversely proportional to pay check size. Though a physicist can probably figure out software whereas the other way is a tougher slog.
If you want to get paid in software don't do something utterly commoditised and popular or you're just a fungible meat flavoured work unit. Get really damn good at something with some longevity in a stable niche.
Reminds me of Hank Hill "I sell hammers and hammer accessories."