Why AI Code Generation Doesn’t Spell the End for Software Engineers

Ian Cackett
8 min readApr 23, 2023

If, like me, you’re a software engineer, you will undoubtedly have heard that our days are numbered.

Artificial Intelligence (AI) is finally capable of writing code… and therefore of replacing us all. Game over.

At least, that’s what the more prophetic and click-optimised headlines on the subject are keen to tell us.

Photo by Burst on StockSnap

But in reality, I’m not so nervous about AI code generation and maybe I’m even a little excited by the possibilities.

What’s coming — for AI, and for engineers like us — will probably be less black-and-white than the headlines suggest. There may even be some upsides if we embrace the change and, to-date, engineers always have.

So I’m not here to throw water on those headlines… just to temper them a little with a dose of reality.

ENGINEERS DON’T JUST WRITE CODE

Coding is just a part of what I do as a software engineer. It’s how I formalise and capture a solution to a problem, so a machine can execute it.

Code is the manifestation of my ideas and the concepts involved. But so are designs, architecture, user stories, proposals, documentation, testing, choice of infrastructure, etc. So software engineering has never just been about code, or about coding.

I also spend a huge amount of my time figuring out what other people — potential users — want from a piece of software and structuring that software to reflect a good solution, mirroring the concepts from a very human problem domain.

It is always experimental, exploratory and iterative. We never simply think up, code, and then release a piece of software in a linear manner. The software we first imagined — or even first coded — is rarely what gets delivered. Projects frequently change direction in response to what we discover here; ambiguities, false assumptions, miscommunications. Very subtle things. Very human things.

You see, software doesn’t exist entirely in a vacuum; it ultimately gets used in human contexts to fulfil human needs. This is perhaps the biggest reason why coding is only a part of what engineers do. So many other activities beyond mere coding need to influence and flow into that code, if a piece of software is going to be successful.

Despite what 1,000 online coding courses and the interview processes at major corporations may suggest, the hardest part about software engineering isn’t just coding a particular algorithm or an optimal function,… it’s also the challenges of building a complete end-to-end system that solves a human problem well.

Admittedly, AI will begin to help with these non-coding, nuanced and human-facing aspects at some point. But when — or perhaps if— that day finally arrives, it will impact knowledge workers in all roles and across all industries, not just software engineering and certainly not just coding.

SOFTWARE ENGINEERING HAS ALWAYS EVOLVED

As it continues to improve, AI code generation will admittedly change where engineers spend our time. It will help us, it will optimise many of our tasks and it will shift our focus towards activities in which humans still outperform AI; perhaps not in speed, but in overall accuracy or sound judgement.

But AI won’t entirely stop us coding either, I’m sure, and it certainly won’t stop us needing to understand code.

In the 1980s (I’m old), I used to code in Assembly language… by hand. Since then, newer programming languages and development tools have lifted our coding productivity by orders of magnitude. In places, they already even generate code for us.

And yet, I still write code.

Each new higher-level programming language is simply a way to express a solution to a problem more elegantly and more concisely than was previously possible in more primitive languages (such as Assembly). All programming languages are just a representation, at some level of detail, of the concepts involved in a solution to a problem.

Extrapolating from that, the ultimate “coding” language is one in which we tell a computer in our very own “natural language” (spoken or written word) what the code should do. And this is very close to what AI code generation promises.

But strong engineers have always retained an understanding of the layers beneath any new abstraction, automation or improvement. This tendency to want to understand what’s going on “under the hood” has helped dig me out of sticky situations many times.

The set of topics an engineer understands is always far larger than the set they necessarily do things with on a daily basis. For software success, we may continue to need to understand and occasionally dig into the things that AI automates.

So while I do admittedly see AI code generation as something of an acceleration and a step change, I don’t see it entirely as a departure from a path we’ve already been on for quite some time: Coding has continually edged closer to modelling solutions in natural language, and has become easier or faster to write by varying degrees with each successive improvement.

Each step along this path has lessened the human engineering effort required, though humans remain heavily involved and retaining some awareness of the knowledge and skills being replaced has certainly proved crucial to overall outcomes.

CODE ISN’T GOING AWAY, FOR NOW

It’s worth noting that AI code generation is not promising us an Artificial General Intelligence (AGI); something that understands and directly executes our every wish.

We’re simply talking about using AI as a tool to generate code for a (non-AI) mechanism to execute. At least for now.

So there will still be code as an end result… which means there are still going to be engineers, in some role and in some number.

We will simply move to higher pieces of the puzzle; the bits AI isn’t yet good at. And there will always be some, whether it’s reviewing and reshaping the code that gets generated, handling the human-facing nuances, or injecting creativity and sound judgement.

Innovation and competitive edge will continue to come from new ideas, not from recombining old ones in new ways. So that means human ingenuity and creativity, assisted by AI. Not from AI simply churning out new combinations or extrapolations of what we previously taught it, though it will undoubtedly also help us to spot opportunities we may have missed.

Admittedly, perhaps we won’t need so many engineers on any one project, and this single fact is likely where the rather clickbait-y headlines come from. But this will also allow us to extend our uses of software into new domains and challenges, which is where engineers will still undoubtedly find opportunities.

I’m sure we will not somehow run out of problems we want to solve using software, and therefore the need for engineers to drive that.

THE REALITIES OF AI-GENERATED CODE

As for the code that AI generates, let’s take the gloss off those headlines just a little…

* We still need to UNDERSTAND it — It’s one thing to ask AI to write code, but another thing entirely to trust blindly that what it wrote is worthy of being used, that it will work and that it will fulfil a user’s specific needs.
If we don’t understand the code, how will we know its quality, whether it is safe, sensible and trustworthy?
So we’ll find ourselves reviewing and trying to understand generated code, in much the same way that we review the code of another engineer today.
This means we must understand the same coding concepts, techniques, data structures etc that the AI chose to use. We are a very long way, thankfully, from blind trust in AI… that is, if we ever let that happen at all.

* We still need to CORRECT the code AI generates — At first glance, AI is impressive in its code generation abilities, and it is tempting to see it as ever-accurate.
But, as with humans, AI is fallible. It is simply putting together the prior knowledge it has gathered and learned from, albeit sometimes in new ways and at a much faster pace than a human ever could.
What we already know is that AI seems ever-confident in its own output, and we will need to spot when it strays outside the envelope within which it performs well. We should look on AI as a clever-but-naive student, and be ready to catch its mistakes… and there will be many.
We should also note that natural language doesn’t possess the precision and accuracy of code. It was meant for humans. It is full of nuance, redundancy and ambiguity. So our requests, in natural language, for AI code generation will always require us to validate the code that is produced as a result. It might not always be what we intended; sometimes by an inch, sometimes by a mile.

* We still need to RESHAPE & INTEGRATE the code AI generates and fit it into a wider picture such as a project or an overall system — It needs to honour the abstractions and domain concepts we want it to represent, for future sake. It needs to be readable (preferably by a human).
Though we’re seeing code generation now, it will be quite some time before we see AI fully understand the entire human-led requirement for a system, and the iterative exploration of that to a user’s satisfaction. Even other humans often struggle with this broad-and-complex picture. So the code that AI generates will likely need massaging into the right form to honour that bigger picture.
What we’ll have for some time is a patchwork of generated fragments or components that somehow need to work well together and complement one another, with a degree of consistency between them.
Despite perhaps being generated from many different AI requests, those code fragments must align, in concepts used, in conventions, and in approach, or else we are creating a patchwork of potential bugs and technical debt.

LEGACY OPPORTUNITIES

Thankfully, there are already plenty of projects that humans honestly really don’t want to code on, and AI will be perfect as a catalyst here.

I’m referring to the huge legacy migrations and modernisations. These “death march” projects will be accelerated at last by AI.

Perhaps finally there will be no excuse for legacy systems or for not porting existing software to new languages and frameworks, and that’s cause for celebration!

ENGINEERS EVOLVE; WE ALWAYS HAVE

Our day-to-day role as software engineers has been changing for as long as software has existed. Many of the things we used to do are no longer necessary and some have been automated, though new aspects of our role continue to emerge in parallel.

AI is a tool, albeit an impressive one, but it comes with its own limitations. Some of these will disappear in time, some will remain. So I feel the changes we’ll see from AI-generated code are exciting ones, not threats, despite being potentially huge.

The role of software engineers will continue evolving as dramatically as it ever has, but it will continue to exist in some form for those of us passionate about pursuing it.

But perhaps this more balanced view doesn’t make for such click-worthy headlines.

--

--

Ian Cackett

Building software to solve hard problems (Software Engineer / Lead / Manager) — Opinions are my own. 🏳️‍🌈