Knowing when the cost of cleaning up convoluted and fragile code is higher than the cost of continuing to work with it, and when it's not worth the long term investment.