Programming is fundamentally different from most other occupations. We are actually building factories - automating manual tasks. If developer jobs start to become scarce, we'll be nearing a situation where there are no jobs at all for anyone. So, as a programmer, you're never at risk of falling into poverty.
So, as a programmer, you're never at risk of falling into poverty. I'm guessing you aren't old enough to remember the dot com bust then...
Today there are so many businesses that needs IT to stay competitive that we would need a bubble of incredible epic propertions to knock us all out. And honestly I doubt there are enough people who can pass as devs that it would even be possible.