AI Downsides

In New GitHub Copilot Research Finds ‘Downward Pressure on Code Quality’, Visual Studio magazine cites a GitClear study that points out that AI for coding results in less maintainable (and therefore costlier) code.

They point out, for example, that copying and pasting code in multiple locations where it is needed, rather than moving it to a single location and referring to it there, is prone to producing repetitive code, that is, code that is not DRY.

In addition, at the time of this writing (January 2024), AI still makes plenty of mistakes; that is, a) misunderstandings of intent, b) hallucinations, and c) downright errors.

Resisting Oversimplification

While the study describes in great detail the pitfalls it found in AI-assisted coding, we must not succumb to the oversimplification so prevalent in these times and generalize that “AI is 100% bad”. We need to realize that the positive or negative value of AI depends on this crucial nuance: the extent to which the developer relies on and defers to AI, rather than supervising it with a critical eye.

The name “Copilot” is apt. It must not be “Autopilot”. However, even “Copilot” may not sufficiently express the subservient position that AI should take; “AI Assistant” would probably be more accurate, and is exactly the name used by JetBrains, the company that produces outstanding IDE’s.

The Optimum Balance

An organization that mandates excessive reliance on AI to quickly reduce labor costs will have a rude awakening when, over time, the poor code quality reveals itself in the form of reduced quality and increased cost.

On the other hand, an organization that completely ignores the immense productivity boost that coding AI offers will “leave money on the table” and fall behind the competition.

Organizational Responsibility

To quote my favorite paragraph in the study:

“If there isn’t a CTO or VP of Engineering who actively schedules time to reduce tech debt, you can add “executive-driven time pressures” to the list of reasons that newly added copy/paste code will never be consolidated into the component libraries that underpin long-term development velocity.”

In other words, resisting the temptation to build working code quickly in the short term at the expense of the medium and long term requires will power and effort, plus initiative or at minimum support from the highest levels of the organization. Those organizations that are not able or willing to delay gratification will suffer the consequences.

Investing in code quality pays off well, but does have an initial cost. In the case of AI, this will be especially important.

Conclusion

The bottom line is that we still need expert software developers to know how to use the tool, appreciating its knowledge and assistance, but taking the lead to verify and integrate it correctly. The AI landscape is changing at astonishing speed. Organizations and their developers need to reevaluate tools and policies frequently to ensure they are making optimal use of this game changing technology.