Doctors on average make more, but they also start their careers burdened with overwhelming debt (a few hundred thousand dollars) and work much longer hours than software developers.
Both my parents are doctors, and I'm a software developer. And you know what? I have it really, really good in comparison.
edit: I noticed that you phrased the question as "earnings potential" -- well, in that case, it's comparable. High-level engineers at FAANG make boatloads of money.
Good points. Doctors do appear to have good career longevity though (in the US). The practice my children go to has several doctors in their late sixties. The doctor who delivered my kids was close to seventy years old. So if you look at career earnings, doctors seem to be in a better spot, as they aren't worried about finding a job from ages 50-65. Is that your parents' experience with their colleagues?