Technical Debt, Rewrites, and Refactoring

Struggling with Legacy Code and not enough time to clean it up?
⛑️️ My First Aid Kit can help you rescue any codebase quickly and safely!

On April 14, 2021, I co-organized the 5th edition of The Legacy of SoCraTes with my partner in crime Adrian Bolboacă.

It’s a half-a-day remote conference where 5 speakers share their tips to deal with Legacy Code.

The Legacy of SoCraTes by Nicolas Carlo and Adrian Bolboacă

For this edition, we focused on prioritizing Tech Debt and learning a better way to approach “rewrite” projects. I had the pleasure to host Adam Tornhill, Sabrina Leandro, and Clare Macrae. I also gave a talk myself! More on that below 👇

As usual, we recorded all the talks so you can watch them now and share them with your friends and colleagues!

Prioritizing Technical Debt as if Time and Money matter

Adam Tornhill made me discover the incredible power of behavioral analysis. With Software Design X-Rays, Adam explains how you can get quick insights from very large codebases, leveraging the information present in version control metadata.

This talk is a sneak peek of all of this. Using CodeScene, Adam explains how you can prioritize Technical Debt in a way that will make sense for the business.

How to rewrite, a bit at a time

Rewrites 🌈

If you’re familiar with my blog, you may already know that I advocate for constant, progressive refactorings. It’s safer and pays off faster.

But what if you’re already working on a rewrite project? You probably can’t just stop everything and start over. Sabrina Leandro talks about such a situation, from her own experience.

She also gave precious advice to avoid the risk of such projects again. As she said:

A refactoring a day keeps the rewrite away!

7 techniques to tame Legacy Code

I took the opportunity of the conference to present my talk. In this talk, I share 7 techniques to deal with Legacy Codebases.

Advice on working with existing and untested codebase are scattered around. I’ve been hunting for them, to try them and share what worked best for me. Here, I wanted to show you 7 different techniques you could try on your own:

  1. Architecture Decision Records (ADRs)
  2. The Brain Dump
  3. Over-Committing
  4. The Mikado Method
  5. Hotspots Analysis
  6. Approval Testing
  7. Coding Katas

If you are looking for more, I’ve written a survival kit with 14 detailed techniques for when tests are missing and deadlines are short: ⛑️

Refactoring Superpowers

Finally, Clare Macrae presented a topic that is overlooked by developers (in my experience): letting tools do the work for you!

You see, when the code you need to change has no test, any change is risky. But sometimes, you first need to change the code before you can even add tests! That’s the paradox of Legacy Code.

How do you safely refactor code when you have no tests? Turns out, your IDE can probably do it for you!

Clare shows you a couple of examples of what you can achieve. Of course, it depends on your language and tooling. But I recommend you look for what your IDE can do for you. In general, it will refactor the code faster and more safely than you ever could!

☝ Oh, by the way! If you’re doing JS/TS and you use VS Code, I’m building an extension to help you do that. Check it out: Abracadabra.

“These talks are really great! Can I have more?”

Sure thing!

There’s no fixed schedule, but I like to organize this short conference every few months. I reach out to a few speakers to build an interesting agenda, then we set up the event.

Everything is FREE. Attending is the opportunity to directly ask questions to these speakers, from the comfort of your home.

If that’s something you want to hear about, subscribe to my newsletter below 👇

I publish my monthly tips on Legacy Code here. I also tell my subscribers in advance about the conference and the agenda, so they don’t miss out. Join them!

Nicolas Carlo

Written by Nicolas Carlo who lives and works in Montreal, Canada 🍁
He founded the Software Crafters Montreal community which cares about building maintainable softwares.

Similar articles that will help you…

Find how to (re)organize code with git

Does your codebase feel like a tote bag of "shared" and "utils" folder? Git may help you find a better structure.

Delete unused code (and how to retrieve it)

Dead code adds noise to the codebase and should be deleted. Yet, deleted code feels harder to retrieve. Here's how to find such code easily with git!

Can AI help me refactor legacy code?

Can assistants like ChatGPT refactor existing code without introducing bugs? Let's figure it out with an actual codebase.

Fake it until you automate it

A pragmatic way for you to start automating deployments of a Legacy system.

← Find more tips to work with Legacy Code