Before the programmer who is automating job X is laid off, the person currently performing job X will be laid off due to the new program. Programmers will outlast the positions they are automating.
A lot of positions require learning algorithms. Once you have those, what's stopping them from learning whole new jobs without programmer's intervention?
If I were the author, I'd worry less about the programmer and more about how this world will handle the potential mass unemployment situation.
It has run up huge debts in a desperate attempt to keep demand up, and is now collapsing under them. It's not a "potential situation", we've had unemployment and underpaid workers for decades and now the bill is in the mail.
A better question is what'll replace it: will general desperation allow communism to rise up again for round two, or will someone come up with something new?