You neglect that a) not everyone has the ability, skill or desire to just jump into programming b) programming can be automated too and c) the US government woefully neglects any attempts at job retraining, unlike European countries, mostly because every effort we've done towards job retraining since Carter was president has been cheap bandaid attempts rather than bottom up serious efforts.
You also gloss over that all of the farmers who were cast aside by automation were absorbed into the very factories we are now discussing being automated into non-existence. Also, simultaneously, millions of people employed in the trucking and taxi industry, including Uber, are facing the extinction of their jobs as automated cars take off. No, there will not be a rise in jobs servicing these cars either, as it's just as easy to develop an automated garage the cars just drive themselves into for service.
You can pretend all you like that new jobs will just pop out of the woodwork for these people but you're delusional. It's taken us 9 years to get back to the job growth we had before the last recession, our economy is not nearly robust enough to absorb the kind of jobless numbers we'll be seeing as automation really gets going.