Artificial intelligence has changed the way we develop applications. In a few seconds, it can generate a complete function, suggest an architecture, or transform an idea into a working prototype (well, it can also take quite a few minutes in this particular case…).
This speed is particularly useful at the beginning of a project. The first features move quickly, repetitive tasks disappear, and we can focus more on business logic.
But over time, a problem appears: AI-generated code is not always designed to evolve. It often answers the immediate request without necessarily considering the future constraints of the project.
In this article, we will look at the main problems encountered with AI-generated code.
Logic duplication
One possible problem with AI-generated code is the repetition of logic.
When we ask an AI to add a new feature, it generally tries to provide a working solution based on the context available. If it does not know about existing components or if the project is large (several thousand code files…), it may create a new implementation instead of reusing logic that already exists.
In a small project, this problem is relatively rare. The developer usually knows the code organization and can easily spot existing features. But when the application grows, with dozens or hundreds of files, the situation changes.
Starting the development of a new feature by simply asking the AI to “add it” without providing the necessary context can lead to duplicated logic. The AI will often produce a functional solution, but not necessarily the one that integrates best with the existing codebase.
Unnecessary abstractions
AI models tend to suggest very general structures to solve a problem. In some cases, this can quickly lead to a multiplication of layers and components, even when the complexity of the project does not justify it.
Abstraction is a powerful tool for organizing code and making it easier to evolve, but it does not always mean better design. An abstraction introduced too early can make code harder to understand, longer to modify, and sometimes less efficient.
Well-designed code is not necessarily the code with the most layers, but the code that uses the right level of complexity for the problem.
When AI suggests “beautiful code” to me, I often tend to accept it. It is difficult to reject a solution that looks clean and well structured…
Too many dependencies
Another difficulty comes from libraries added automatically. To solve a problem, AI may recommend an external dependency even when a native solution already exists.
For example, adding a complete library to handle dates:
composer require date-helper-packagewhen PHP already provides suitable tools:
$date = new DateTime();Every dependency brings:
- additional code to maintain;
- security updates;
- compatibility risks;
- new documentation to learn.
An application with too many dependencies often becomes more fragile.
Code that is difficult to explain
Another problem appears when developers accept generated code without really understanding it.
AI can produce a complex function:
$result = array_reduce(
array_filter(
array_map(
fn($item) => transform($item),
$items
),
fn($item) => $item !== null
),
fn($carry, $item) => merge($carry, $item),
[]
);This code may be correct, but will it still be understandable in six months? Will another developer be able to modify it easily?
In a professional project, readability is often more important than the amount of code written. We have to think about our colleagues ^^
A slightly longer but explicit piece of code will usually be easier to maintain:
$transformedItems = [];
foreach ($items as $item) {
$result = transform($item);
if ($result !== null) {
$transformedItems[] = $result;
}
}
return mergeItems($transformedItems);Some people might say that an AI will be the one reading this code to modify it in the future… They are not completely wrong oO
The problem of limited context
An AI does not always know the entire project. And fortunately, otherwise it would cost a lot in tokens…
It may ignore:
- existing conventions;
- historical constraints;
- expected performance requirements;
- previous technical choices.
It therefore often generates a solution that is correct locally, but not necessarily adapted globally.
In my opinion, a developer must keep a validation role:
- understand the proposed code;
- check its integration;
- simplify when necessary;
- remove what is not useful.
AI remains an excellent tool when used correctly
Despite these limitations, AI-generated code provides many benefits. It can significantly reduce the time spent on repetitive tasks:
- generating basic structures;
- creating tests;
- writing documentation;
- converting code;
- finding simple errors.
A developer can then spend more time on important decisions: architecture, user experience, and business logic (personally, I am heavily involved by project managers and clients).
AI works particularly well as a development assistant. It speeds up code creation, but the final quality still depends on the developer’s ability to review, understand, and improve that code.
Conclusion
Generative AI is here, and it will probably remain an important part of software development. It is a great ally for developers.
However, I remain more skeptical about some practices that involve running several agents in parallel (risk of burnout?) and multiplying code generations without real supervision.
The “vibe coding” phenomenon also leaves me doubtful. Quickly creating a prototype is one thing; building a reliable, secure, and maintainable application over several years is another.
The future will tell us how these new ways of developing will evolve. In a few years, will I still be a developer in the same way as I am today? Or will I simply still be a developer?










Leave a Reply