I'd much rather deal with whiteboard interview bullshit a few times in my life, then go through residency in the medical field.
This has nothing to do with how programmers are hired, and everything to do with the business cases that building software serves. Even if programmers were hired like doctors, they'd still be cyclically losing their jobs, because their jobs are closely tied to the willingness of the economy to spend large amounts of money on custom software.
If you want a job for life, then you want to be in a profession that does something unconditionally useful. Healthcare, garbage pickup, teaching, farming, being a janitor. We're going to need people doing all that long after <insert Silicon Valley fad of the month> is dead and buried.
At least for doctors this isn't universally true. There's continuing education/certification, (which you have to do every $period) there's public reputation, there's lots of networking. From what I've seen the interviews take few hours in one day and people usually already know each other.