Can Programming Be Liberated, Period? (2008) [pdf]
wisdom.weizmann.ac.il
wisdom.weizmann.ac.il
I tend to make my living on legacy code. In fact, I enjoy it more than green field projects because it's trickier. Also, because nobody else wants to touch that code, I have more freedom :-) And (if I'm honest) it's an easy escape from the occasional colleague who always insists that "it must be like X" because they lack experience to see things in terms other than X. When you get to the point of, "Well, we can't reasonably do X because of all our legacy problems. What's plan B?", there is a lot more room for compromise and the task becomes a lot more fun (IMHO).
But on greenfield projects, having a tool that helps you understand when you are making the code worse would be incredibly helpful. We've got some metrics (like cyclomatic complexity, class size, method size, etc, etc) but it's still pretty easy to write code with terrible consequences even when following linting rules.
This is where I can see the potential for AI and ML to help: a kind of permanent pair programming partner that can keep an eye on the big picture. For example, warning you when you have too many options in your API, or when your architecture is not isolated enough (or too isolated). It's a lot of fuzzy judgement calls, so it's hard to find specific rules to help you. I suspect there are some startups looking at this, but I admit that I haven't followed their progress at all.
Not having the how and what however is a bit of a receipe for disaster by asking something for nothing - undefined behaviors are bad. Programming depends upon clarifying your ideas - design does period. Even if you could teach it a phone interface it would still have to deal with standards to actually be a phone.
The precise "how" can be left to programs with machine learning or other optimizations like compilers of course but one needs a search space/technique for it to generate.
And there are pitfalls to keep in mind like spurious correlations,data poisoning to make a toy turtle be perceived as an AK-47, and model glitch exploitation. It will still give you what you ask for in the training functions - not what you really want. You may want a more efficient form of locomotion so it finds a perpetual motion device trick that needless to say won't work in the real world.
That happens with humans as well with perverse incentives and unclear requirements.