I think this is more to do with economic factors than AI taking over. You can't just replace programming jobs with AI, because you still need someone who understands programming to command the AI what to do. Otherwise you'd end up with managers writing "make my software prodcut better than all the competitors". I accept that maybe some of the most menial jobs could be replaced by a highly skilled programmers who can just crank out all the boiler plate code through an AI, which might result in a dip in junior positions. But if you're an employer with X skilled programmers, churning out code at a rate of 2Y, using AI, why wouldn't a company choose to double their output, and therefore revenuer, rather than keep the same revenue, but with half the programmers?