Although a lot of the time Barney Stinson appears carefree and brimming with confidence, he is in actuality quite a fragile person with more than a few issues, particularly abandonment ones. He used to be an idealistic hippie who wanted to join the Peace Corps with the love of his life Shannon, until she cheated on him and left him for a richer more successful guy.
Hippie!Barney: But... I love you.
Shannon: But he has a boat.