Recently I approved a pull request from a colleague, that had the following description: “That’s a hacky way of doing this, but I don’t have time today to come up with a better implementation”.
It got me thinking about when this “hack” might be fixed.
I could recall many times when I, or my colleagues, shipped code that we were not completely happy with (from a maintainability / quality / cleanliness aspect, sub-par functionality, inferior user experience etc.).
On the other hand, I could recall far far fewer times where we went back and fixed those things.

I’ve read somewhere (unfortunately I can’t find the source) that “The longer something remains unchanged, the less likely it is to change in the future”.
Meaning – from the moment we shipped this “hack”, it then becomes less and less likely to be fixed as time goes on.
If we don’t fix it today, then tomorrow it’ll be less likely to be fixed. And even less so the day after, the week after, the month after. I observed this rule to be true, and I think there are a few reasons for it.

Surprisingly, it isn’t because we’re bad at our jobs, unprofessional, or simply uncaring.
It’s not even because of evil product managers who “force” us to move on to the next feature, not “allowing” us to fix things.

There are a few, interconnected, reasons:

Loss of context and confidence

The further removed you are from the point where the code was written, the less you understand it. You remember less about what it does, what it’s supposed to do, how it does it, where it’s used, etc.
If you don’t understand all its intended use cases, then you’re not confident that you can test all of them.
Which means you’re worried that any change you make might break some use case you were unaware of. (yes, good tests help, but how many of us trust their test suites even when we’re not very familiar with the code?)

This type of thinking leads to fear, which inhibits change.
The risk of breaking something isn’t “worth” the benefit of improving it.

Normalization

The more you’ve lived with something, the more used you are to it.
It feels like less and less of a problem with time.

For example – I recently moved house. In the first few days of unpacking, we didn’t have time or energy to re-assemble our bed frame.
It wasn’t a priority – we can sleep just as well on a mattress on the floor. There are more important things to sort out.
We eventually did get round to assembling it. SIX MONTHS after we moved in.
For the first few days, it was weird walking past the different bits and pieces of bed; laying on the floor.
But we got used to it. And eventually, barely thought about it.

Higher priority

This is a result of the previous two reasons.
On the one hand, we have something that we’re used to living with, which we are afraid to change.
We perceive it as high risk, low reward.
On the other hand, we have some new thing that we want to build / improve. There’s always a new thing.
The choice seems obvious. Every single time.

You’re now relying on that bad code

Even though we know that this code is “bad”, we need to build other features on top of it.
And we need to do it quickly, before there’s a chance to fix this “bad” code.
So now we have code that depends on the “bad” code, and will probably break if we change the bad code.

For example, we wrote our data validation at the UI layer. But we know that data validation should happen at the domain layer. So we intend to move that code “later”.
But after a while, we wrote some domain-level code, assuming that data received from the UI is already valid.
So moving the validation out of the UI will break that new code.

A more serious, and “architectural” example:
“We’re starting out with a schema-less database (such as mongoDB), because we don’t know what our data will look like. We want to be able to change its shape quickly and easily. We can re-evaluate it when our data model is more stable”.
I’ve worked at 3 different companies that used this exact same thinking. What I found common to all of them is:
1. They’re still using mongoDB, years later. 2. They’re very unhappy with mongoDB.
But they can’t replace it, because they built so much functionality on top of it!

What’s the point, then?

So, we realise that if we don’t fix something right away, we’re likely to never fix it. So what? why is that important?

Because it allows us to make informed decisions. Up until now, we thought that our choice was “either fix it now, or defer it to some point in the future”.
Now we can state our options more truthfully – “either fix it now, or be OK with it never being fixed”. That’s a whole new conversation. One which is much more realistic.

We can use this knowledge to inform our priorities:
If we know that it’s “now or never”, we may be able to prioritise that important fix, rather than throwing it into the black hole that is the bottom 80% of our backlog.

We can even use this to inform our work agreements and processes.
One process that worked pretty well for my team in the past, was to allocate a “cleanup” period immediately after each project.
The team doesn’t move on to the next thing right away when a feature is shipped. But rather, it has time to improve all those things that are important, but will otherwise never be fixed.

If we keep believing that a deferred task will one day be done, we’ll never fix anything.
If we acknowledge that we only have a small window of opportunity to act, we can make realistic, actionable plans.

(Case in point: I thought about writing this post while in the shower yesterday. When I got out, I told my wife about it. She said “Go and write this post right now. Otherwise you’ll never do it”.
And she was right: Compare this, written and published post, to the list full of “blog post ideas” that never materialized. I never “wrote it later”
I’m going to take my own advise now, and delete that list entirely.)

23 thoughts on “Stop lying to yourself – you will never “fix it later”

  1. I enjoy your blogs, could you please link your social media, or icons, also fix the rss feeds? so my rss reader will pick up on you?

    Like

  2. The problem is that developers are put under pressure to deliver
    quickly. In order to solve something properly, requires time and some efforts to collect feedback before the actual implementation. So its the short-sighted of management/ product owners and often their lack of technical awareness that plays key role in such situations.

    Like

  3. This is an excellent post and I’d love to get in touch. I think it ultimately comes down to we forget – for me at least about 3 months is enough to adapt to change. It definitely happens on a non-linear time, the first few days are difficult. The same as breaking habits.

    Like

  4. When I was in Test & Evaluation the Command had three definitions: Mission Critical, Mission Essential and Mission Required. MC almost always got funded, ME would sometimes get funding and could also creep up to the MC stage. MR would only get funding if if became a ‘hard break’ and became MC. If the workaround worked, it became the way of doing business, even if the maintenance team suffered.

    Like

  5. The other side is that perfectionism has its own drawbacks.
    Why start-ups do not write clean code, use languages like PHP? Ship and live or die being “perfect”.
    Do your best and leave the rest to others.
    Cheers

    Like

  6. Do it or forget about that. This is what I’ve learned in the last decade.

    I recalled there used to be something called “read it later” that allows people temporarily save the unread contents to read later, however how many people do go back and read it later 🙂

    Like

  7. I agree to everything you wrote. Concerning the “Loss of context and confidence” part, I would go even further and say: It is good to lose your confidence in being able to change things later because in fact you do become less and less able to do it. It’s not just a bad feeling you have, but in fact a real danger for your product.

    Like

  8. We’re right in the middle of converting our corporate insurance accounting system to a big, bran-new system that’s been planned and in the works for years, and we’re already seeing large swaths of the development team letting stuff slide so they can get the new system up and running, and claiming that they’re going to fix a zillion things later. Sure they will. You can never convince upper management to spend a little extra time and money to do things right from the start because they probably won’t be here by the time everyone realizes what a ratcluster it has become 5 or 10 years from now.

    Like

  9. “starting out with a schema-less database (such as mongoDB), because we don’t know what our data will look like”
    You build an application when you have no clue what your data will ultimately be? LOL. Try some analysis, proto-typing, etc. before deploying your production code. Don’t know how to do context diagrams, data flow diagrams, logical and physical database design? Or simply don’t want to take the time? Then just have your app stuff everything into a key value array and live with the resulting nonsense.

    Like

  10. Most people in software don’t stay anywhere long enough. I’m a programmer and I’ve been at the same place for 36 years. And in that time I have fixed many things that I put off to later.

    Like

Leave a comment