Surprised nobody has mentioned the halting problem [1] yet, which logically proves programming can never be automated.
[1] https://i.imgur.com/HVeO7ek.png (CH 8, Algorithms - Sanjoy Dasgupta, Christos H. Papadimitriou, and Umesh V. Vazirani)
[1] https://i.imgur.com/HVeO7ek.png (CH 8, Algorithms - Sanjoy Dasgupta, Christos H. Papadimitriou, and Umesh V. Vazirani)
And if humans can write code, a sufficiently advanced AI will be able to write code too.
I don't believe this proves that programming can't be automated, though. Humans too aren't able to prove completely that what they write is correct, it doesn't stop them from making programs.