To answer this question, we need to first define the scope of what is being asked.
A programmer does two different things:
a. digs in and understands the problem better than any one else
b. designs and writes the program to solve that problem
It is possible to create a machine that will select from a set of existing designs and writes a modified version of the predefined program that will run.
However, the first part is something that humans do far better.
Why? When Watson can analyze X-Rays better than humans can, why can't it do that for programming problems?
The problem isn't doing analysis on a specific domain. The problem is that the domain is constantly shifting. Thus, the human capacity for learning, coping with a changing environment, and changing outcomes is far greater than that of AI.
Technically, a programmer is someone who turns a design into an implementation. An automated programmer (AP) wouldn't do requirements analysis and design. These would be done the old-fashioned way by humans who would continue to gather requirements and have design reviews, etc. The AP would know how to use software technologies like Oracle and full-stack web programming to turn these designs into code. The AP would get handed the program specs in a design language.
It would have a memory of low-level and enterprise design patterns.
Right now, an AP wouldn't be much good for maintaining existing programs, but it would be excellent at maintaining code it had written. As time goes on when more code is written by the AP maintenance costs would go way down. Since maintenance consumes most of a software budget, this would be the best reason to have an AP.
The AP could easily adhere to the practice of agile development. It would write its own automated tests, use a version control program and write incremental code. The longest part of its sprint cycle would be for humans to sign off on what it had done. Development and testing would take about 60 seconds.