I have been writing and dating for roughly the same amount of time now: 21 years. Both pursuits involve sharing your most hidden self with another person who, in the beginning at least, is a complete unknown. It's terrifying, embarrassing and pure, gilded magic, which is why we continue to bare ourselves, even in the face of repeated disappointments.
In writing, it helps that rejection slips are understood to be a necessary part of learning and growing; they even become a matter of pride for up-and-coming writers. And yes, it's often the novels that didn't get published, and the stories that became stillborn on the page, that teach us the most. But there's no such celebration in our culture of the relationships that didn't work out, and the lessons they teach us, maybe because the failures are that much more difficult to look back at and consider. But for me, it was an attempt to create an amulet against my past romantic disappointments that led me to finally take something out of the lessons to be learned in lost love.