This is part of ExpertCodingSkills.
Once you've coded something non-trivial, you should rewrite it, from scratch, using the lessons you've learned from doing it the first time.
Quality control types tend to freak out at the prospect of doing something so insane, but we all know why this has to be done. The code can't be modified any longer without breaking it, and that includes bug fixes, feature enhancements, and performance upgrades. This is why TestYourOwnDamnCode is so important, particularly the creation of automated test scripts.
By the time something's finished, there's usually a better language or platform to target anyway.
The most reliable code is a dead fork. You can force developers to fix minor bugs in a dead fork, but two things will happen:
The developers will leave, if they're good
Your customers will leave, if they're smart
The result being that you will find yourself with sub-par developers and customers.
