Why are people saying that AI will replace software developers?

Unless you live somewhere in the woods and have no access to the internet, you have seen many videos or heard people saying that AI will soon replace software developers. Is there any truth in this?

But before I answer this question, let me explain why many people are convinced that it will happen. But to explain this, I need to explain how traditional software development works to understand what has changed.

Let’s take a website as an example. Typically, work starts with a working prototype. Any interactive website requires a frontend and backend. Frontend requires design. Unless the website is very trivial, it requires 3 different skills and typically 3 different teams.

Firstly, the design team approves a draft design of the website and defines different workflows. Then the frontend team takes this design and starts working on the website’s frontend. In parallel, the backend team, in collaboration with the frontend team, defines the backend API and starts implementing it.

Even a simple website can take a week or two to reach basic prototype functionality. But much more realistic is one or two months before others can do anything useful to this prototype.

The prototype is extremely useful for … emm, prototyping. People can spend months discussing user interactions on the whiteboards and then figuring out that the workflows they built do not work in the real world.

Typically, there are at least several prototype iterations until everybody is happy with how the website works. Then the real development starts. If the developers are not experienced, they will take that prototype code and start to convert it to production code.

Experienced developers start from scratch and take bits and pieces from the prototype and carefully review them from a performance and security standpoint to make sure that all parts of the software are production-ready.

Then the company will release this website to the public. The first several months will be filled with critical fixes, bugfixes and usability improvements. Then the second version arrived because many features simply didn’t make it into the first version. Then a third version arrives that is mostly a stabilization release. This is a moment when the website became usable, and most initial features were implemented fully as initially intended.

If you compare prototype code and code from the third version, you will see that there is pretty much no common code. The production code was simple and very straightforward. The production code looks much more complex and handling much more cases. It is much more battle-hardened. The production code is the goal, and it is why any company pays a lot of money to developers. Because production code is the end goal.

Now, let’s jump to how things changed with AI. You can ask AI: “Please create a website that will allow gym trainers to schedule training sessions with their clients. It should look like … and do this and this. It should use technologies A and B”. And an hour layer AI will generate a mostly working website that does what you requested.

And this is an exact moment when everybody starts to say that software developers are not needed anymore. I can just ask AI to do what I need to, and I will get it much cheaper. But they missed a very critical detail. This will be a prototype code at best.

Do you think Google, Microsoft, Facebook, or any other big compaly publish their source code? Of course, no. Most of it is closely guarded secret, and they don’t want anybody else to have access to it. As a result, AI was trained on very simple prototypes at best. This will be 99% of its training data. Small examples, tutorials, etc.

That training data will not have code with proper error handling, telemetry, and many other things that just clutter code and do not help understand what they are written for. For example, imagine a blog post explains how to read from the file; it typically explains just that and not how to handle every single error that may happen (and will happen in production).

As a result, if you deploy AI-generated code to any production environment, it will typically die very quickly because it is of prototype quality. For example, in one of the examples of this case, I found on the internet, that AI-generated code for search sends a request to the database on every keypress in the search textbox. It works just fine on the local machine and in the test environment, but quickly overloads the database when real users start to use it. Very often AI-generated website will have many security issues because, again, most of the code on the internet does not care about security much.

But the next problem is way worse. Imagine you asked someone to create a website for you. They did it. If, let’s say, 6 months later, you ask again, they will create a website that will be about the same. AI will generate a website that is different each time you ask it. If you have a long function and find a problem at line #31, AI will often regenerate the whole function. If you are a software engineer, then you can reason whether this change is good or bad, but what if you are not?

Then there is another thing that AI is quite bad at – reusability. We, humans, are lazy. We don’t want to do repetitive work, which is why we create common functions in our code. This way, we can fix a bug in a single place instead of searching through all our source code for similar places. AI is quite bad at extracting common code, and very often, you will find many places that do almost the same thing, just coded slightly differently.

If you want all pages on your website to look the same, you need to have common styles for all your pages. It requires a lot of work to force AI to use them correctly, and most of the time, it is just faster to do it by hand.

AI will not be able to process large codebases due to token limitations. As a result, it will not be able to see the whole program picture and how different modules are connected with each other and how they communicate. As a result, you will need to explain it to AI via the prompt. Very often, I found that I would quickly rewrite code by myself instead of spending time crafting a prompt again and again and waiting for a response in between.

The worst part is that I don’t know how long it will take to create the correct prompt, and sometimes I found out that I wasted way more time than doing it by hand. With AI, it often looks like I’m very close to my goal, almost there, just need a minor change, then another one, and yet another.

Now back to my original question. My answer is as follows: No, AI cannot replace software developers at this stage. It can generate initial code quite fast, but after that, there will be an everyday struggle. You will fix one problem and add another. Fix here, break there. Your code will constantly change, and instead of writing code, you will fight AI and craft the correct prompt.

The developer's performance is not measured by how long it takes to write initial code. The developer’s performance is measured by how long it takes to write battle-hardened production code. The code will work on production for a very long time. And AI currently cannot write quality code like this.

On a funny note, Microsoft stated that they write 30% code with AI. Perhaps it is coincidental, but about this time number of issues with GitHub just skyrocketed. Every day, I delete 20-30 messages from GitHub about regressions. Sometimes (quite rarely) the service stops working altogether.

I hope it helps someone.

Comments

Post comment