r/AskProgrammers • • 3d ago

How do you decide between a quick fix and a proper fix? Do you have a rule, or is it judgment every time?

I keep running into the same tension and I don't think I have a consistent rule for it: something is broken, a quick fix stops the pain today, and a proper fix takes noticeably longer. Sometimes the quick fix is obviously right (a hotfix during an outage). Sometimes it's how a codebase fills up with things nobody dares touch.

Last month I had to choose between patching a validation bug in a shared API module in about twenty minutes, or rewriting the validation layer over a couple of days. I patched it, and I'm still not sure that was the right call.

These are the factors I can think of:

  • Reversibility - can the quick fix be removed later easily, or does other code start depending on it?
  • Blast radius - if the quick fix is wrong, how bad is it, and how soon would we notice?
  • Recurrence - will this happen again? If so, a quick fix just postpones the cost.
  • Who else touches it - a hack in a file only I use is different from one in a shared module.
  • Whether the quick fix gets a follow-up - a ticket with an owner and a date is debt with a plan; "we'll get to it" often isn't.

What I'd really like to know:

  1. Do you have an explicit rule or checklist, or is it judgment each time?
  2. What makes you say "no, this needs the proper fix now"?
  3. How do you make sure a quick fix actually gets revisited - and does that ever work in practice?
  4. Is there a point where you stop and say the deadline is the problem, not the code?

I'm especially curious how this differs between small startups and larger companies, and between product teams and internal tools. Thanks.

2 Upvotes

11 comments sorted by

4

u/CS_70 3d ago

There are only proper fixes. Quick fixes are just tomorrow's problems.

3

u/realmauer01 3d ago

Nothing is more permanent than a temporary solution.

2

u/Optimal-Savings-4505 3d ago

Turns out my boss only wants quick fixes. I did an actual fix on a part that I worked on, so that I could forget about it and move on.

For the next release, there's another component that needs the same fix for my implementation to actually matter. I told him about it and he yelled at me, even started going ad hominem at me. Suffice it to say the guy has lousy priorities and bad manners.

I'll have to do the proper fix next time, and depending on his conduct, it may be the last fix I do for that company. It has to be done right.

1

u/dariusbiggs 3d ago

There are only issue tickets.

A problem occurs, a ticket is created, work done such as a "quick fix" gets mentioned by commit and actions. A "quick fix" is a minimal change, such as toggling a feature flag, or fixing a typo, or blocking a CIDR in a firewall, or restarting a process, that is it. Changes to IaC are not quick fixes, changes to code are not quick fixes, changes to runtime configuration controlled by code are not quick fixes, they are items of work.

Initially priority is based upon probability of re-occurance, blast radius, security implications, privacy implications, and amount of users affected. Security and privacy affected tasks are always the highest priority. Things that affect all users are the next highest priority.

Every issue gets added to the development backlog, either for code fixes, documentation, or the creation of runbooks or whatever is needed.

1

u/pvera 3d ago

By many, many years of experience watching quick fixes unravel and bite people in the ass. The extra time that it takes to do it right is a fraction of the time that is going to be wasted trying to decide if it was a better idea to do the proper fix.

At work we have a special category of the quick fix: the coward's way out. It's literally the bare minimum amount of duct tape you can apply to get it done. The difference between the two is that the coward's way out is actually discussed, it's not on the spot like the quick fix.

Do you have an explicit rule or checklist, or is it judgment each time?

Judgement, one learns a thing or two after close to 30 years writing code.

What makes you say "no, this needs the proper fix now"?

Experience.

How do you make sure a quick fix actually gets revisited - and does that ever work in practice?

Add a code comment explaining what's going on, hopefully with a ticket ID. If you use the ponytail mcp, you can add "shortcut:" to the comments, then later when you run /ponytail-debt it will harvest these tagged comments.

Is there a point where you stop and say the deadline is the problem, not the code?

Why can't it be both? You could be dealing with unreasonable expectations and bad code at the same time.

1

u/Traveling-Techie 3d ago

I ask myself how fragile a fix is. What will break it?

1

u/W31337 3d ago

Quick fix only if you need it NOW or ONCE.

1

u/Salazar20 3d ago

I write a to do comment and hope I remember

1

u/jimmiebfulton 2d ago

Solved problems compound into emergent capability. Unaddressed paper cuts, rough edges, and kicked cans will bury you in technical debt.

1

u/Prudent-Ad4509 2d ago

“Proper fix” usually brings more risk with it for many different reasons. But if the problem is both genuine and not urgent then you can chip away at it bit by bit framed as a minor code cleanup as part of other tasks.

0

u/oskaremil 3d ago

A quick fix is chosen when shit is burning. Then, I write a task describing how to revert the quick fix and suggest how to implement a proper fix.