It is my belief that programming cannot be automated. Hear me out. I'm a programmer by trade, and I've often had this discussion with people outside of the field. The most common objection is, "Well, what happens when we get computers/programs/AI's sufficiently complex that we simply have to speak what we want our program to do, and the AI can immediately spit out a program to do exactly that?"
The thing is, in my experience at least, the actual writing of the code is the EASY part of programming. The HARD part is learning how to be INCREDIBLY PRECISE and SPECIFIC about what you want the computer to do. So even if we have perfectly intelligent robots to write our code for us, the onus would still be on us to specify PRECISELY and EXACTLY what we want our program to do - and this is the very definition of programming.
Here's an example. It is silly, exaggerated, and would probably never be a real scenario, but I think it makes the point: Suppose you are preparing a presentation for your boss, and you need some statistics for it. You need to know the average age of every house within a particular zip code. You say to your magic automated-programming-AI-box.
You: "Okay Box™, Run a program which calculates the average age of all houses in zip code 96818"
Box™: "Well what?"
You: "What is the answer to the program you just ran?"
Box™: "Oh, I didn't know you wanted me to save the result."
You: "Oh okay, I would have thought that would be obvious, but understandable. Okay Box™, run a program which calculates the average age of all houses in zip code 96818, and GIVE ME THE ANSWER."
Box™: "Well what?"
You: "What is the ANSWER?!"
Box™: "The answer is in your email box - that's usually how I give you answers, so I figured--"
You: "Look, I really REALLY need to get this done quickly, and I don't have access to my email terminal right now. Okay Box™, can you please run a program which calculates the average age of all houses in zip code 96818, and speak the answer aloud to me, right now?"
Box™: "Sure. Processing. Done. The answer is five thousand, six hundred and eighty two years old."
You: "Whaaat? That's ridiculous! There can't even be ONE that old, let alone nearly HALF! How did you come up with that answer??"
Box™: "I calculated this area's average population over the course of human history, which mostly entailed wandering tribes up until humans started building permanent residences approximately 200,000 years ago. Those first houses were VERY old, but there were very few of them. Modern humans have built VERY MANY quite young houses in recent years, so with my best estimates, the average house is ~5,000 years old."
You: "Wait what? You're counting houses up to 200,000 years ago?! Those can't possibly even be standing anymore!"
Box™: "You are correct - the vast majority of these structures have ceased standing long ago. I took averages of archaelogic discoveries in this area for the past several decades, and calculated how many ancient structures must exist buried underground, or on the surface, but collapsed."
You: "WHY WOULD I CARE ABOUT ANCIENT HOUSES UNDERGROUND AND PILES OF RUBBLE?! Okay Box™, can you please run a program which calculates the average age of all houses in zip code 96818, counting only structures erected after 1800 A.D., and only including structures which remain currently at least 90% standing, and speak the answer aloud to me, right now?"
Your boss: sticking his head in your doorway "Johnson, got that report ready? I need it by 2:00!"
The problem here is that even if you DO have some miraculous oracle-box which can generate an answer, YOU are still tasked with being overtly precise in exactly what you are asking for from the data. There MAY be cases where we can trust machines to make presumptions about what it is we really want based on context, common sense and past requests, but once we've gone that far, we haven't really automated the task so much as created another sentient creature to whom we have now delegated it; how is that any different than just hiring someone to do it for us? (I do not mean that last question rhetorically - literally, what is the philisophical difference?)
And this contrived example was just a simple query for data from a database. "Real" examples would entail requesting systems whose functions are many orders of magnitude more complex. Sure we might be able to create AI's which are capable of spitting out code for them, but we'd still have to be so precise in describing those systems that we would find ourselves back where we started - as programmers (though perhaps speaking a slightly different programming dialect).