Computers will not write code by themselves. Someone else's code will be so Great that a lot of people will think it's intelligence by its own, but it will still be someone else's code.
Machine learning works by writing a framework for a computer to learn, then throwing tons of examples at the algorithm. The base may be created by humans, but the creativity actually comes from within the algorithm itself.
In the very long run if we can reproduce human intelligence in a machine, maybe this will become a reality, but we are probably far, far away from it. (and further than we think we are).
Yeah may be but who knows what the future holds!!
Why not? programs as Training sets can do it I guess. Atleast for the mundane tasks in software like a large chunk of devops and UI stuff.