If AI gets to that level where the programmer is completely replaced, well, regarding "the top" that "wants us gone"... many of them would also be gone. There's no reason a general AI of that power could not automate (to give typical "the top" occupations) much of finance, law, health care, or even management / executive work.
(For comparison: the average public school student in the US costs $12,000 to educate. And yet plenty of people will say that even that is not enough.)
But the good news is if we don't fuck up, that number will continue to grow nonlinearly, just as it has for many decades. We will live to see it cross the point where it really is high enough to give everybody a comfortable life.
Why does it cost $30,000 to educate a class of 30 kids for a month? The salary of the teacher should be <$5,000. Double, or triple that to include rent and other costs. It still comes out at half of $30K.
Will it? When you look at most First World countries in general nobody there has to starve anymore.
In the Middle Ages only liege lords could get by without ever having to work. Nowadays, even middle-class people don't necessarily need to work till retirement age.
Use of food banks has increased in the UK, and hunger is very much present: https://en.wikipedia.org/wiki/Hunger_in_the_United_Kingdom
This is a policy choice. For many voters, it's far more important that nobody "gets something for nothing" than nobody starves to death. This has resulted in the benefits system being increasingly punitive leaving some people without money for food for weeks at a time.
Tell that to the people who insist that Real Programmers™ always write these things from scratch, never use a library to help them with it, etc.
2. This may just be my projects, but people tend to re-make excel on the web with it.
3. Its easy to get started coding with it, but quickly turns in to spaghetti filled with glass shards when you try to do advanced things with the controls.
Other than that, implementing an AI that is capable of understanding business problems and solving them via code probably is nothing short of artificial general intelligence. In that case we won't have to worry about not being needed anymore anyway because by then we'll either very rapidly have a post-scarcity economy or you know ... Skynet ...