Technical debt is like a credit card.
Credit cards aren’t really painful as long as you use them simply for expedience, always paying them off at the end of the month. The banks don’t like that, so they won’t give you a huge credit limit, but you’ll have little difficulty getting cards from other banks if the need suddenly arises.
But if you keep making the minimum payment every month for a couple of years, missing a payment every few months, you’ll notice that making the minimum payment doesn’t lower the remaining balance next month; you’re at best treading water. Then, if something unexpected comes up where you need to make a significant charge, or your income becomes shaky and you miss more payments, the bank wants the money back. All of it. Now, please. On second thought, forget “please”.
You can seriously twist your mind (and kill your productivity) if you insist on fixing anything that even hints of technical debt immediately, before completing the larger task that code was part of. Numerous startups, and post-startups, have taken controlled hypersonic flight into terrain doing just that to themselves. As with most well-functioning social activities (politics, economics, organised religion), software development (specifically with regard to technical debt) richly rewards moderation, and disavow extremists.
I happened to blog about just this sort of thing only yesterday, in fact.
