At any rate, that would be the optimistic viewpoint, that they could actually get retrained and get jobs and compete for wages. What is likely to happen is that they'll have extreme difficulty finding any work, the income gaps will widen and there'll be even more disaffected workers.
This is the product of a particular culture that goes back to how the places currently employing the most programmers are currently funded. When the bubble bursts, the macho candle-at-both-ends death march bullshit will give way to professionalism.
There also will probably be a glut of programmers by then so it doesn't help the hypothetical retrained truckers.
The safest jobs, at least for another 20-30 years, will be things like doctors, where you can't just retrain to do it. If you didn't start right out of high school in college, you're not getting that job.
This is one of the things we'll need to solve. Nobody should be desperate to feed their families. If someone still is, it's because our civilization still gets a failing grade.
It's a vicious circle.
One would be that, in the 1800s, they would have been predicting _fewer_ entry-level jobs in a given field (e.g. replacing bunches of manual workers with machinery to allow one person to do the work), not _no_ entry-level jobs in said field.
The other difference, here, is that the job shift you're discussing (except, arguably, for "programmer") is into jobs which require prior training to have any likelihood of getting a position.
One additional problem - even assuming that new entry-level positions in other industries existed, that's going to be a huge loss of income for the families affected, and anything that causes that drastic a reduction of income across any significant population of people is going to have huge ripple effects.
We need to start talking about a post-work economy and how that will work. Because that's going to happen. If automation pushes us there without the appropriate policies in place, it is going to be absolutely devastating.
And as this article touched on, the working-class generation is going to be deeply troubled by the idea of anyone getting anything without working hard for it. The concept of "if you don't work, you don't eat" is deeply ingrained into their psyches. So it is going to be a very uphill battle.