How far in the future?

We're a long way from AI or building-block platforms being able to replace programmers in any meaningful sense. Or from demand for custom-built software tapering off. Over the next 2-3 decades we'll see more and more software engineers employed.

But in the long run, yes, AI will replace almost all of us (assuming we don't do something dumb like submerge the planet in nuclear winter before then). How long? Wish I knew. Probably less than two centuries.

Any time frame in between then? It's difficult to impossible to know how long the process of developing AI that powerful will take, how long it will be until it's cheap enough to handle most demand for software, or when the inflection point will be in terms of employment.