Pythonium

Python, What else ?

Rework in software development: Why reworking is part of the job

We often talk about productivity, deadlines, and delivered features. It's easy to measure what has been created, much less so the work required to revisit what already exists.

Yet rework is an integral part of our daily lives as developers. Revisiting a feature, rethinking an architecture, fixing an implementation, or even starting from scratch on part of the codebase: none of these situations necessarily means failure.

On the contrary, recognizing when a solution needs to be reworked is often a good quality to have.

You don't always understand the problem on the first try

These days, we generally work in iterations. We develop an initial version, compare it with actual needs, gather feedback, and then evolve the solution. And thankfully! The old V-model approaches, where each phase theoretically had to be completed before moving on to the next, left me with some rather unpleasant memories. We got things wrong quite often...

This way of working inevitably means revisiting things that have already been developed. A delivered feature may reveal limitations we hadn't thought of, a new request may challenge a technical decision, or another feature may expose inconsistencies in the existing codebase.

Let's take a fairly common example: an API that allows users to retrieve data based on several criteria. An initial version is developed and released. As the software evolves, new needs emerge: combining more filters, handling more complex sorting rules, or optimizing queries that have become expensive.

We could simply keep adding conditions and fixes to address each new request. But at some point, reworking part of the implementation, or even revisiting its design, becomes more worthwhile than continuing to add patches.

And this doesn't just apply to newly developed features. We can absolutely revisit a module that has been working for several years because usage has changed, new constraints have appeared, or the overall architecture has evolved.

Rework is therefore not necessarily the result of poor planning. It is also a natural consequence of iterative development, where software is built and improved progressively.

Some modules, developed more than ten years ago and modified along the way, probably deserve a good rework. An opportunity to take a step back, simplify the code, and start again on a healthier foundation, this time taking the necessary time to do things properly.

The cost of never reworking your code

There is a fairly natural temptation to avoid touching code that already works. Why risk breaking something that is doing its job?

The problem is that small imperfections tend to accumulate. An extra condition here, a special exception there, a temporary workaround that becomes permanent... Gradually, the code becomes harder to understand, and every new change requires more effort.

This is especially true when we hold on to technical decisions that no longer make much sense for too long. I've already worked on 15-year-old code that had received numerous changes over the years. Unfortunately, we never had enough time to do things properly, and eventually we reached a dead end: every new change became difficult, and anything involving significant changes was simply rejected...

In this situation, rework helps reduce accumulated complexity and restore a healthier foundation.

Reworking doesn't necessarily mean throwing everything away

Rework is sometimes associated with a complete rewrite. However, there are several levels of rework. It can simply mean extracting an overly long method (when we add two lines, we're often too lazy to refactor, but after five or six changes, it all starts to add up), removing an unnecessary section of code (We often write too much...) or revisiting error handling.

In other situations, a larger part of the application needs to be reviewed: changing how a module works, replacing a library, or modifying the data structure. And sometimes, certain decisions really do require a complete rewrite.

The important thing is not to confuse the need to rework a solution with the desire to start everything from scratch. A complete rewrite is a significant investment and often introduces new risks. If a few targeted changes can achieve the same result, they are generally preferable.

User feedback is a good reason to start over

A feature can perfectly meet the specifications and still be unpleasant to use. This is a situation we encounter regularly: the developer has imagined a workflow that makes sense from their point of view, but users have a different way of working (As a developer, this happened to me quite often when I was starting out. Less so today, but it still happens from time to time).

Feedback then helps uncover problems that weren't necessarily visible during development. It could be an overly complex interface (That's not my strong point, but AI helps me quite a bit now...), an unnecessarily long sequence of steps, or behavior that doesn't fit well with the rest of the application.

Being willing to revisit your work based on this feedback is essential. A technically correct solution isn't necessarily a good solution for its users. And sometimes, just a few hours of rework can considerably improve the overall experience.

Finding the right balance between rework and delivery

However, constantly reworking existing code can become counterproductive. We all know the situation where a feature is almost finished, but we eventually decide to rethink its architecture, then modify another part of the code, before questioning a technical decision that was actually working perfectly well.

Perfectionism can easily become a source of delays. We all know a developer who tends to do this...

We therefore need to distinguish between changes that bring real value and those that are essentially a matter of personal preference.

A few questions can help put things into perspective:

  • Does the current code really prevent future changes?
  • Has maintenance become too costly?
  • Is there a performance, security, or reliability issue?
  • Will rework actually simplify how the software works?
  • Is the cost of reworking justified by the expected benefits?

There is no need to have perfect code. What matters is having code that is understandable, reliable, and maintainable enough to meet the project's needs (If no further changes are planned, for example, there is no need to make it extensible...).

Rework is part of a developer's experience

With experience, we gradually learn to anticipate difficulties better. We become more capable of identifying poor abstractions, unnecessary dependencies, and decisions that could make future changes more difficult. But that doesn't mean we'll stop doing rework.

Even an experienced developer can overlook a constraint, misunderstand a requirement, or discover a better approach after starting to code. It still happens to me despite my 20 years of experience... even with AI by my side.

The arrival of new tools, technologies, and practices can also make certain implementations less relevant than they were a few years ago.

We also need to accept that our own skills evolve. Code that seemed perfectly satisfactory to us three years ago may now seem unnecessarily complicated. And that's actually a good sign!

To wrap things up

Rework is neither automatically a waste of time nor proof of incompetence. It's a normal part of software development. Of course, it's better to avoid having to completely rebuild a feature because of poor planning. But trying to avoid all rework is just as unrealistic.

Software projects evolve, requirements change, and our understanding of problems improves over time.

Ultimately, a good developer isn't just someone who knows how to produce code quickly. It's also someone who knows when their work needs improving and isn't afraid to question it when doing so brings real value to the project.

Come on, time to get reworking! 🙂




Popular posts