They seem to follow a pretty similar career arc. If you take a typical CS grad they're going to go through a couple years as a junior dev, couple more as a more senior one, and then five years or more in they are ready to be in charge of their own project. That's pretty similar to the intern -> resident -> attending pattern that doctors follow.
Honestly, the biggest difference between having a career in programming and being a doctor is the gate keeping. In programming, you can drop out of high school and 20 years later be an expert in the field. There's a path for talented people to go from junior -> dev -> senior -> lead -> principle -> whatever. There's no path like that in medicine. Sure, as a nurse you can go from LPN -> RN -> NP but that's where it ends. Your only option at that point is to spend 4 years and hundreds of thousands of dollars. And there's really no reason for that.