>"I bet a third of them once were physical scientists/mathematicians who mostly regret their degrees"
Would mathematicians truly be regretting their degrees, if they decide to work in software? I read that mathematics one of the best degrees for a career in software engineering, as computer science is very closely related to mathematics (to the point where studies of algorithms are largely the same for mathematics and computer science students).
Theoretical parts of computer science is connected to discrete mathematics, sure. But that is only a subfield of mathematics and mostly happens already at CS departments, so you'd get a CS degree anyway.
It is also possible that aptitude for math is related to aptitude in software engineering.
However: The mathematics content of 90%+ of mathematics degrees awarded is fully irrelevant to 95%+ of software development tasks. And when that 5% task needs that some kind special mathematical insight, the people who want that task done are going to get the top professional they can find for it. Maybe the prospective math student is going to be that professional, but I don't recommend planning a career for it.
I am not saying there isn't work where some math is useful but the most commonly used applied stuff ... say, linear algebra ... is typically covered in a respectable engineering program; degree in mathematics would be superfluous. Proving theoretical properties of Hilbert spaces or measurable sets or bifurcations of dynamic systems or advances in differentiable topology or fascinating behavior of cellular automata or whatever is going to be gigantic waste of your time if you won't use it later in your career or you don't find it intrinsic motivation in itself.
And five years of gluing APIs together that help get more people to click advertisements - you'd be surprised how much math you forget. Machine learning can be better for exercising math, but most company's do not want anyone doing anything new. Same goes for physical sciences in my experience. You basically get a PhD to do associates level work. Even if you know a better way, that comes after you get ten yrs experience and have authority over projects. See the first sentence of this post for a catch 22. Bleh.
Would mathematicians truly be regretting their degrees, if they decide to work in software? I read that mathematics one of the best degrees for a career in software engineering, as computer science is very closely related to mathematics (to the point where studies of algorithms are largely the same for mathematics and computer science students).