The XY Problem (https://en.wikipedia.org/wiki/XY_problem) is when you have a question about a solution that you have already come up with for a much different problem.
Code is written to create programs that solve problems for people. Programs keep track of appointments, send messages to other people, and various other things that keep our lives running. A properly trained AI could do all these things without writing any code.
We have to step back and think about the problems that we are trying to solve. What do we really need computers to do. These are the real problems we need AI to solve. This might take several layers of stepping back. Some whole industries exist to track and store data for other industries that solve some of these problems. Do we really need traditional websites? AI could be connected directly to data and display it however we want it displayed. We will still need computer hardware. AI has to run somewhere.
As a developer this is much scarier than AI writing code. This would mean we wouldn't need to write code, or review AI written code. There just wouldn't be as much code anymore. AI may still make use of some things, database drivers, video codecs, lower level things that could still be useful to connect to existing systems or display content encoded in specific formats.
These AI systems would of course be different than what we have now. They would be trained on very different kinds of data, not text, not code. I don't know how to build an AI like this, but I'm very confident that someone can figure it out.
The future is a scary and exciting place.