Besides your level of interest in each field, it’s important to note that at the top tech companies, software engineers typically receive 2x the RSUs as data scientists / data engineers for a given level. This is non-negligible and can range from an extra $30k to $100k per year depending on your level (base and bonus are typically the same though). Add in the time opportunity cost of getting a PhD, and a top software engineer can save up considerably more money by age 30 than a data scientist.
Money certainly isn’t everything, but I’m considering switching to software engineering (from data science) because I would like to reach financial independence more quickly than my current trajectory allows.