Tech debt isn't always bad, It's just the trade of we need to consider while we are crushing code. Let's learn to cut the right corners, so future engineers can thank us later!

Tech debt is a fascinating subject. There always seems to be differing opinions about how important it is. My "hot take" on the situation is everything is tech debt, from the language you chose, to documentation you write, to the frameworks and libraries you are using; these all come with opportunity costs and will require ongoing upkeep. I think the secret to handling tech debt is not to avoid it, but to embrace it. Keep it at the front of you mind, make choices that minimise it, and make sure your team has a way to keep track of it. You can't fix something if you don't remember it needs work!

Here are my top ten tips when it comes to dealing with tech debt:

Spot the Mess Early

Don't play hide and seek with technical debt. If there's a mess, acknowledge it while you're building stuff. It's like cleaning up while you cook — makes everything easier later.

Pick Your Battles

Not all debt is created equal. Tackle the big issues first — the ones that can cause a ruckus. It's like doing the dishes before they pile up into a mountain.

Schedule Cleanup Days

Throw some tech debt cleanup days into your plans. It's like having a spring cleaning day for your code. Allocate time to tidy things up and keep the codebase spick and span.

Team Effort

Make it a team thing. Everyone plays a part in keeping the code healthy. Share the responsibility and don't leave it all to one superhero coder.

I've found that the superhero coders are usually the ones that make more than their fair share of tech debt!

Let Tools Help You

Use fancy tools to automatically catch issues. It's like having a personal assistant who points out where you left your socks lying around. Linters and formatters are huge, if you aren't using them you should be, life is too short to debate spaces vs tabs, or same line curly braces.

Although, clearly you should use spaces unless you are some kind of sociopath!

Sprinkle Some Refactoring Magic

Refactor regularly — it's like rearranging your furniture to make the room feel fresh. Break it into small bits, so it's not a massive weekend DIY project.

Explain Tech Debt to Non-Techies

Tell the non-tech folks why you need to fix stuff. Paint a picture of how it affects the overall masterpiece. It's like explaining to your roommate why using a blunt knife in the kitchen is a big deal. The longer you use it, the more dangerous it gets, and the slower you need to go to stay safe.

Speed vs. Quality Balance

Sometimes you gotta choose speed over perfection. Just don't forget to come back and tidy up the place. This is a double edged sword, you have to weigh up the tech debt of a given implementation against the upfront investment. Accepting some tech-debt isn't the worst thing in the world if it gets a feature to market in the time frame your business requires to succeed.

Remember, if the business fails, you lose your job and the tech debt is the least of your problems!

Learn from Your Mistakes

Treat tech debt cleanup like a video game level. Learn from each run, adapt your strategy, and get better with each attempt. Code review is a fantastic time to go over the tech debt you've created with you colleagues. Talk to your reviewer about why you made the choices you did.

Give Props for Good Work

High-five the team when you clean up a particularly messy corner. Positive vibes and a pat on the back go a long way. In a way, building features is what your product team celebrates, but if you really want to see a team of developers happy, fix that build script that takes 45 minutes to run so they can iterate faster. I guarantee you'll see big smiles next time time they are testing/debugging the code-base.

Remember, handling tech debt is like keeping your kitchen tidy — it takes a bit of effort, but it's worth it in the long run. Happy coding cleanup! 🧹💻