I'd honestly rather have the "bulletproof tenure" that doctors then acquire after they get through the hazing. Getting laid off every time a spreadsheet jockey in accounting makes a bad projection, is pretty disruptive. (as are the times when a competitor buys your employer just to shut them down, and etc: plenty of scenarios where you lose a job due to no fault of your own are rather the rule than the exception) - Most competent engineers can always get another job. But in that process, you end up with a different commute, or even having to relocate, deal with setbacks in financial plans, and etc. The instability some of us experience is kind of not worth the other perks. And after 20+ years, it's kind of annoying to have to apply as if I'm fresh out of school when I have a solid work record on my resume, verifiable by contacting my former co-workers and managers I've provide as references.
> Getting laid off every time a spreadsheet jockey in accounting makes a bad projection, is pretty disruptive.
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.
I'd much rather deal with whiteboard interview bullshit a few times in my life, then go through residency in the medical field.