Computers and apps are already writing their own code. But, honestly, I think software devs would be the last jobs to go. If you can make a computer self aware enough to not need humans to maintain it what job can't you make a computer reliably do at that point?
Them BS jobs that cats who do free code camps and bootcamps do will go away because that level of development can be replaced by tools that code from business logic.
The scientist level and principal level roles wont go anywhere because they or the owns who engineer the stuff to get people out the paint. Anything beyond that we wont see in our life time.