What is Clean Code and what is the impact on software quality?
- Cloud & Infrastructure
- article
There is a silent irony happening now within development teams. With the arrival of AI-based code copilots, such as GitHub Copilot, Cursor, Amazon CodeWhisperer, and others, the apparent productivity of teams has skyrocketed. Lines per hour, features per sprint, deploys per week: the numbers have improved.
But what about the quality of what is being built? That is a question that few leaders are asking with the necessary depth.
The reality is that AI-generated code tends to work. The problem is that code that “works” and code that “is sustainable” are two very different things. And that is exactly where Clean Code, a concept with decades of history, becomes central again, not as a technical book topic, but as a strategic pillar for any organization that wants to grow with technology in a healthy way.
What does Clean Code mean?
Clean Code is a development philosophy centered on communication, and its primary recipient is not the machine, but the next human who will read that code.
The machine executes any valid instruction. But the code lives. It is read, modified, debugged, and evolved by people, often by people who were not present when it was written. Therefore, clean code is one that communicates its intention clearly, can be understood without mental archaeology, minimizes surprises, and facilitates change.
In practice, this translates to well-known principles:
- Names that reveal intention: variables, functions, and classes with names that explain what they do, without the need for comments.
- Small and cohesive functions: each function does one thing, and does it well.
- Absence of duplication (DRY — Don’t Repeat Yourself): repeated logic is logic that will diverge.
- Explicit error handling: no silent exceptions, no hidden failures.
- Tests that document behavior: tested code is code that can be changed with confidence.
Clean Code is not a checklist. It is a mindset that directly impacts the speed with which a team can evolve a product over time and, therefore, the responsiveness of the company to the market.
What are the Clean Code practices in the era of Artificial Intelligence?
When a developer writes code manually, they need to think about each line. This cognitive friction, which many saw as a cost, has a valuable side effect: it forces reflection on what is being built.
AI copilots have removed much of this friction. This is great for repetitive tasks and boilerplate. But it creates a real risk: the developer starts to accept suggestions without necessarily understanding or questioning them.
The practical result we see in real projects is a silent accumulation of problems:
- Verbose and redundant code because the AI generated more than necessary and no one reviewed it.
- Rigid or overly generic abstractions, which work at the moment but create unnecessary coupling.
- Automatically generated tests that test the implementation, not the behavior are fragile in the face of refactoring.
- Lack of cohesion in style and pattern in code bases where different team members accepted different suggestions from the AI.
Here is the provocation that every technical leader needs to make to their team: the AI generated this code, but who is responsible for it?
The answer must be clear: the developer. And this responsibility requires them to evaluate what was generated with the same criteria they would use to evaluate what they wrote themselves.
Clean Code practices in the era of AI
They evolve in three fronts:
- Critical review of the suggestion: accept AI output as a starting point, not as a final result.
- Refactoring as a habit: does the generated code solve the problem? Yes. But is it communicating the intention clearly? That is the second mandatory step.
- Quality-oriented prompts: mature teams are learning to include Clean Code constraints in the prompts themselves — asking the AI for descriptive names, smaller functions, no duplication, with behavior tests.
AI can be a powerful ally of Clean Code, but only if the team has the culture and criteria to direct it correctly. From this perspective, João Paulo Miranda, CEO of Objective, is categorical when it comes to AI adoption in development teams: “The technical foundation needs to be solid first. Empowering the team in AI on a fragile foundation only amplifies and generates more problems.”
What is the role of Clean Code alongside code copilots?
The honest answer is: it depends on who is in control.
In teams that already had engineering discipline, such as rigorous code review, defined coding standards, and a culture of continuous refactoring, AI copilots represent a leap in productivity without loss of quality. The AI takes care of the mechanical work; the developer takes care of the design and clarity.
In teams that were still building this culture, copilots accelerated production, but also accelerated the accumulation of technical debt. Code that would have taken weeks to become a problem now becomes a problem in days.
The warning sign is when: the team can deliver features quickly, but each new feature is slower than the previous one. This is technical debt manifesting, and it feeds on code that lacks clarity, cohesion, and tests.
What is the difference between Clean Code and Clean Architecture?
It is common to see both terms used interchangeably. They are complementary concepts, but they operate at different levels, and confusing them leads to incorrect decisions.
Clean Code
It is about the micro level: the readability, cohesion, and clarity of each unit of code: a function, a class, a module. It is about how the code communicates its intention to whoever will read it tomorrow.
Clean Architecture
Clean Architecture is the concept systematized by Robert C. Martin, the same “Uncle Bob” of Clean Code, that operates at the macro level: how the system components relate to each other, how the dependencies flow, how the business domain is protected from infrastructure details.
Analogy
Clean Code is about how each brick is shaped. Clean Architecture is about how the bricks are organized to form a solid structure.
In practice, you can have an elegant architecture with confusing internal code and vice versa. The ideal is to work on both levels in an integrated manner.
For organizations undergoing digital transformation, the most common and effective sequence is:
- Establish Clean Code culture and practices at the team level.
- From this base, introduce architectural discussions oriented toward Clean Architecture — or patterns like Hexagonal Architecture, Domain-Driven Design (DDD), or Ports and Adapters.
Without step 1 consolidated, architectural discussions tend to stay at an abstract level without real penetration into the produced code.
How to teach and spread the culture of Clean Code in a company?
This is the point where most efforts fail, not due to lack of intention but due to excess theory and lack of practical anchoring.
Experience in real projects shows a clear pattern: when the introduction of Clean Code starts with theoretical training and a list of rules, the impact is limited. When it starts with practice embedded in the actual workflow, results appear.
Some approaches that work:
Code Review
Code review is the main vector of quality culture in development teams. But it needs to be a space for learning, not judgment. Comments that explain the reason for a suggestion, that show alternatives, that ask questions instead of imposing solutions, these formats educate the team in a continuous and contextualized way.
Refactoring as a planned task
One of the biggest management mistakes in product teams is treating refactoring as invisible work that happens “in spare hours.” Refactoring needs to have space in the backlog, prioritization criteria, and visibility for leadership. Without this recognition, the team that refactors seems less productive than the team that accumulates debt, and the right behavior ends up being punished.
AI copilots as a teaching instrument
An emerging and powerful approach: using the copilot itself as a pedagogical tool. Comparing AI-generated code with versions refactored by the team. Discussing: what did the AI do well? What could be improved? What is a clearer function name? This practice creates contextual reflection and also trains the team to use AI more critically.
Visible technical leadership
Culture is not transmitted through documents. It is transmitted through the behavior of those who lead. Tech leads and senior engineers who demonstrate, in their own contributions, the principles of Clean Code, who refactor in public, who ask for reviews, who recognize when something is confusing, create a clear signal about what the organization values.
Clean Code is a strategic decision
For Jorge Sellmer, CRO of Objective, the diagnosis appears even before any technical analysis:
“The client doesn’t come saying Clean Code. They say that the team is stuck, that each new feature breaks another thing. When you look into it, the root lies in the quality of what was built back then.”
An example can be found in a successful project of Objective with one of the market leaders in insurance in Brazil. In 2010, the company operated mainframe systems with growing maintenance difficulties, high operational costs, and limitations in implementing new functionalities. The code had become an obstacle, and much accumulated technical debt was manifesting as an operational crisis.
The solution was a rebuild with the correct foundation: modern architecture, Java language, Oracle database, and a dedicated framework for migration and data validation. The result was a platform capable of integrating over 200 life and pension insurance products, managing 322,000 individual policies, and sustaining approximately R$ 7 billion in reserves with efficiency, scalability, and real evolution capability.
The lesson is: the cost of rebuilding a system that should have been well-built from the start is always greater than the cost of building it well. Clean Code is what prevents the company from reaching that point.
Objective has been developing complex solutions for large companies for over 25 years. If you want to discuss how to structure your team’s engineering maturity or accelerate your agile transformation with quality, speak to our experts.
Questions and Answers on the topic
No. In fact, it is even more important for junior and mid-level developers; it is during training that habits are consolidated. The earlier the culture is absorbed, the lower the cost of correcting it later.
It is not an implementation with a start and end date; it is a cultural change. Teams that already have structured code review and engaged technical leadership usually see practical results in two to three months. However, the consolidation is continuous.
In the short term, it may seem so. In the medium and long term, it is the opposite: teams with clean code deliver faster because they do not waste time deciphering their own code, correcting unnecessary bugs, or redoing what was poorly constructed.
Some clear signs: each new feature takes longer than the previous one; bugs in production appear in parts of the system that have not been touched; onboarding new developers takes weeks; no one wants to touch certain parts of the code.
They depend on context and prompts. AI generates code that works, but working is not the same as being readable, cohesive, and sustainable. Without critical review and proper guidance in the prompts, copilots tend to generate verbose code, with duplications and inadequate abstractions.
Clean Code is a subset of good practices, with a specific focus on readability and communication. Good practices also involve security, performance, testing, and architecture.
Translate to financial and speed impact. Show the cost of recurring bugs, the time lost in onboarding, and the increasing slowness in deliveries.
It prevents and reduces, but does not solve it alone. Technical debt also comes from architectural decisions, lack of tests, and deadline pressures without room for refactoring.
By code review. It is the most accessible, contextual ritual with the greatest cultural impact. Start with simple criteria: clear names, small functions, no duplication. Define what the team considers acceptable code. Then evolve. The culture of quality is built one review at a time.