I've learned to detach my emotions from my code about 12 years ago when I saw how little impact it had on the business. It was a good lesson to study and serve our customers (and their problems) rather than my solution to it. Jonas Downey writes it well: "The trick is to change how you evaluate forward progress: the long-term survival of your contributions is irrelevant. The important thing is that the product is evolving into the best version your team can create together."