Eh, I wouldn't say that. Maybe if they do CS, are an absolute stud and work for a FAANG company. But the average CS grad is going to make $50-100k starting out, maybe mid 100s after some experience and most CS managers never break $200k.
Yes, we all know people who went and worked for Apple, Google, etc and make $250k at 22 years old. In the CS world, these are the derm and ortho chads who match at Mass General. Bringing up those anecdotes is like saying you should just marry an ortho joint surgeon so they can make a median income of $700k and make you their stay-at-home wife/husband.
Realistically, a CS grad and an average doctor will have a much lower net worth at age 60 than two average doctors. Heck, by age 40-45, many two doctors couples will have caught up.