Sometimes, you find out that a piece of code has a serious bug or a logic mistake that only get triggered in some cases.
Maybe that code doesn’t work under certain conditions or cannot handle some specific input, or maybe it has a security flaw.
It happens, right?
In these cases, you may be tempted to say: “Ok, I’ll Fix This Later…”
But you should never say that. Because, you know… we all know that’s not going to happen.
Here’s what will really happen:
As long as the bugged code is still around, you will be forced to write workarounds and temporary fixes anywhere in your app… until it will be too late to fix everything.
Eventually, you will just forget about the bug. Which is not good.
Of course, not every single bug needs to be fixed immediately.
But it’s important not to keep adding workarounds instead of eating the frog and fixing the code for good.
How do you break this habit?
The best thing to do would be to fix any issue right away, but I know that’s not always possible. In these cases, mark the bugged code with a tag (like the classic /* Bugfix */) and add a review process very soon in your schedule.
Very soon means either in 2-3 days (more than that will make you forget about the bug details!) or as soon as you finish your current job (which, again, should be over in no more than a couple of days).