Where do you live? Are there other economic opportunities there for a smart, motivated ex-programmer?
Many programmers are good enough generalists to displace people in other jobs if the work dries up. Just like Teach for America college grads displace and outperform professional classroom teachers.
I'm in London, where I earn enough to rent a 2-bed 700sqft flat. Not exactly retraining for years money. But in any case, I think I'll be fine, it's others I'm worried about. I grew up in a poor rural area - I've seen what sudden unemployment does to people, even if they are smart and motivated.