<P> Barney and Robin start out as friends, but he falls in love with her after they impulsively sleep together in "Sandcastles in the Sand". Throughout Season 4, he struggles with his feelings for her, until they finally get together in the season finale "The Leap". They become a full - fledged couple in season 5, but they break up in "The Rough Patch" when they find that they are making each other miserable . They never truly get over each other, however, even while they are dating other people . In the eighth season, he launches an elaborate plan to win Robin's heart (encouraged by Ted's future wife) that ends with Barney proposing to her . She accepts, and they get engaged . The final season revolves around their wedding weekend . After much doubt and soul - searching, they get married in "The End of the Aisle". The series finale, "Last Forever", reveals that, after three years of marriage, they get divorced because Robin's work schedule prevents them from spending any time together . They do not see each other again for several years, until Ted's wedding . </P> <P> Barney and Robin start out as friends, but he falls in love with her after they impulsively sleep together in "Sandcastles in the Sand". Throughout Season 4, he struggles with his feelings for her, until they finally get together in the season finale "The Leap". They become a full - fledged couple in season 5, but they break up in "The Rough Patch" when they find that they are making each other miserable . They never truly get over each other, however, even while they are dating other people . In the eighth season, he launches an elaborate plan to win Robin's heart (encouraged by Ted's future wife) that ends with Barney proposing to her . She accepts, and they get engaged . The final season revolves around their wedding weekend . After much doubt and soul - searching, they get married in "The End of the Aisle". The series finale, "Last Forever", reveals that, after three years of marriage, they get divorced because Robin's work schedule prevents them from spending any time together . They do not see each other again for several years, until Ted's wedding . </P> <P> Barney has two other serious girlfriends throughout the series: Nora (Nazanin Boniadi), on whom he cheats with Robin; and Quinn (Becki Newton), a stripper to whom he proposes, but with whom he breaks up upon realizing that they don't trust each other . </P> <P> In 2008, the book The Bro Code, ostensibly written by Barney, was published . Three other books ostensibly written by Barney, Bro on the Go (2009), The Playbook (2010), and Bro Code for Parents: What to Expect When You're Awesome (2012), were also published . </P>

What was barney's job on how i met your mother