This statement originates from Alfred Lord Tennyson
's "In Memoriam A.H.H.
I hold it true
, whate'er befall;
I feel it, when I sorrow
'Tis better to have loved and lost
Than never to have loved at all.
"'Tis better to have loved and lost" often gets thrown around as a platitude meaning "don't fret so much over getting dumped, at least it was fun while it lasted." Just as frequently, as in most of the writups in this node, it gets rebutted for that same meaning. But that's just not fair to Al.
If we're dealing with the quote in its original context, it's important to realize that the person Tennyson's referring to is dead. He's not saying "'tis better to have loved and had the person in question decide you're actually kind of annoying and they're not interested in dating you than never to have loved at all." This is real loss we're talking about here, permanent loss, that nobody could have controlled. And I don't know how callous you'd have to be to say, on thinking of your dead best friend (or possibly "best friend"), "if he had to die, I wish I'd never met him in the first place." Whatever level of callousness it is, I've never reached it. When someone dies, you think about how grateful you are for the time you did have; how much they enriched you; how glad you are that you loved them and let them know while there was still time.
And if you're lucky and careful and very, very strong, maybe you can feel that way about people who have gone away rather than died. And that is, indeed, better.