Lily brings a goat home from school. Ted celebrates his 30th birthday. Barney and Robin deal with the repercussions from their night together. Barney hires Marshall to help him find a loophole in The Bro Code.
The episode begins with the aftermath of the events of Sandcastles in the Sand. Barney and Robin are in bed together. Robin proposes that they pretend their tryst never happened, and Barney agrees. However, Barney feels quite awkward and uncomfortable around Ted at MacLaren's later in the day. Hoping to find an excuse for his and Robin's actions, Barney seeks out Marshall to help him find a loophole in the Bro Code, a document very important to Barney's life as a bro (including articles placing bros before hoes, banning bros from hooking up with each other's mothers, and banning eye-contact between bros during a Devil's Three-way). Allegedly written by Barnabas Stinson in the 18th century when Benjamin Franklin and George Washington were too busy to write it themselves, the Bro Code proves to be a very tight document that Ted has followed flawlessly and Marshall fails in finding a loophole. Though she seems fine with it at first, Robin finds the secret even harder to keep than Barney and eventually admits to Ted that she and Barney slept together. That night, when Barney picks up Ted in a limo to take him to Ted's 30th birthday party, an outraged Ted yells at Barney, telling him how wrong it was to sleep with his best friend's ex-girlfriend and that Barney has always tried to use Bro code against Ted but didn't even have the decency to stand by it and that he is the bad Bro and that he always thought that he was the limit to Barney's ridiculous antics. Ted ends his rant by telling Barney that he not only does not want to be Bros anymore, but also does not want to be his friend anymore.
Meanwhile, Lily rescues a goat named Missy when a farmer (played by Alan Fudge) brings it to her kindergarten class and horrifies her students by going into great detail about what will happen to Missy when she visits the butcher. Lily plans to give the goat away to animal control, but becomes attached to the goat while waiting for Ted to arrive at his birthday party. Future Ted reveals at the end of the episode, after hinting at the destruction the goat would do, that he had the story wrong: Everything involving the goat actually takes place during his 31st birthday, at which point — Future Ted also reveals — Robin is living in the apartment.
Barney gives a fake history lesson about the Founding Fathers commissioning his ancestor, Barnabus Stinson, to write The Bro Code.
Marshall tells Barney that "Ted has upheld [The Bro Code] time and time again". Ted and Barney have served as each other's wingmen since the night they met in 2001, as depicted in Pilot and How I Met Everyone Else. Ted and Robin meet after Barney asks her "Have you met Ted?".
Barney references the Bro Code for the first time in Zip, Zip, Zip, when he promises Robin not tell Ted that she likes him.
In Zip, Zip, Zip, before he and Robin get together in Come On, Ted gives Barney his blessing (albeit seemingly sarcastically) to pursue Robin, while here, Ted gets upset with Barney for hooking up with her.
The story of the goat is alluded to in Milk, where Future Ted mentions that his 30th birthday was fun "apart the goat in [his] bathroom".
Barney mentions mentally "storing" the image of Robin's breasts in "the BPEG folder"; he discusses the concept of "boob images, or BPEGs" with Marshall in Where Were We?.
After asking Robin "Guess who nailed the chick from Metro News 1 last night?", Barney requests (and is granted) a high five.
Barney loves shopping from novelty stores; he wants everyone to come with him to a new Sharper Image store in Slap Bet.
Future References (Contains Spoilers)
In Rebound Bro, Randy hands Barney a Sky Mall catalogue, referencing the numerous gadgets he buys from Sky Mall here. Also, in False Positive, Barney shows Ted and Robin a picture of a diamond-studded suit in the Platinum Sky Mall catalogue.
Ted eventually forgives Barney for sleeping with Robin in Miracles.
One of the Bro Code articles Ted has abided by include alerting Barney to a girl-fight. Barney displays his interest in girl-fights again in Intervention, Happily Ever After, and Jenkins.
Future Ted mentions that Robin would be living with Ted by his 31st birthday. Robin later moves in with Ted in Not a Father's Day.
Ted angrily asks Barney if he wants to nail his mother too, and in Little Minnesota, Barney reveals that he kissed Ted's mom. When he elaborates (and embellishes) upon the story in Home Wreckers, he reveals that it happened soon after the events in Brunch, meaning he has already broken the Bro Code with Ted.
While here, Barney is seen reciting Article 89, which states that the mom of a bro is always off-limits (with the clarification that a stepmom is fair game under certain circumstances), when Ted reads from the Bro Code in The Broken Code, it is Article 104 that states this, without the clarification.
Marshall finds a contract in Barney's office detailing the poisoning of the water supply in Lisbon, Portugal, hinting at Barney's job being to sign off on the company's illegal contracts, thereby making himself a scapegoat, as revealed in Unpause.
How did it happen? Ahh? Barney? I want to know. Tell me exactly how it happened.
You mean, what position?
(Jumps at Barney)
You can't tell anyone. Attorney-client privilege.
Why are you doing this to me?
Because I need you, Marshall, as my lawyer to prove I didn't do anything wrong.
How can I help you as your lawyer? You didn't break any laws, did you? Robin knows that you slept with her, doesn't she?
I didn't break any state or federal laws. But I think I broke a much, much higher law. The Bro Code.
In my experience the way it normally goes is: we lie her for a while, make a little awkward chit-chat.
Then I make up some cabinet meeting/heart surgery/rocket test flight I've got to be at. Slip out of your apartment and never call you again.
And later at the bar you tell your good friend Robin the story of your latest conquest and she thinks to her self: "Who is this sad, self loathing idiot who climbed into bed with Barney Stinson?"
Actually, you usually say it out loud.
So, You're not mad?
No, I'm not mad. Well, Robin and I broke up a year ago, we both dated lots of people since then, I'm with Stella now. Seriously, I'm fine with this.
I'm so relieved to hear you say that.
Yeah, yeah. Oh, I just remembered, my mom is coming in to town next month. Maybe you'd like to nail her too!!
Okay, here is the deal Barney: the second my feet touch the floor this never happened.
Okay. Wait (Barney lifts the sheet up). Right click, save as into the bpeg folder and okay. This never happened. It's a good plan.
Now we go back to exactly the way things were before.
Okay. Right. So, Robin?
Guess who nailed the chick from Metro News One last night?
(talking about having a goat in the apartment) Where is she gonna sleep and eat... and go to the bathroom?
(making a sound goats make whatever the word for this may be)
Ok, where is she gonna sleep and eat?
Notes and Trivia
Goofs and Errors
In the limo, when Ted derides Barney for sleeping with Robin, Ranjit yells at Barney in Persian. Ranjit was previously said to be from Bangladesh, but actor Marshall Manesh is from Iran, where Persian is spoken.
Lily asks if Barney is "all smooth down there", but in Columns she saw Barney naked when painting his portrait and so would already know the answer to that question.
Almost certainly Lily's blocked any images of naked Barney from her memory.
It's possible she meant the way Barney has sex; being "smooth"
It's also possible she was referring to the state of his pubic hair, which naturally could have changed since the time she painted him.
While on the roof with the goat anticipating Ted's arrival at his party, Lily tells Barney that "Stella just arrived." However, Ted (as the narrator) later realizes that the events involving the goat took place a year later, in the episode The Leap, by which point he and Stella had broken up. In fact, Stella moved to California as described in the epilogue of As Fast As She Can, the episode immediately preceding The Leap. But it could be that only the goat related incidents were from his 31st birthday and not anything else mentioned. Because when Lily is talking to Robin about having sex with Barney, the goat is there, but the whole Robin/Barney sex thing happened around Ted's 30th birthday.
It is revealed that in The Bro Code, 'A mother of a Bro is off-limits', but Barney has admitted to kissing, and perhaps sleeping with Ted's mother, yet Barney does not acknowledge he has broken The Bro Code in this aspect.
In the limo, Barney says "But not me, brah". Retrospectively, it was clearly stated by Barney that they would never say "Brah" anymore in Little Boys. He says to Marshall "One, we agreed we would never say "Brah" anymore. It was a good week, we had a lot of fun but it's over".
Allusions and Outside References
It's revealed that Ted's birthday is April 25th, 1978.
The Bro Code is an actual book released as a tie-in for the show. Several of the quoted articles in the show are the same as in the book, although under different article numbers.
Curiously enough, according to Bro Code, Article 38, a bro should never punch another bro in the groin, "even in a fight to the death". Early in the episode, Marshall claims that Ted never broke the code. But Ted breaks the Bro Code by the end of the episode, when he punches Barney in the groin in the limo. Although Ted did punch Barney in the groin it can be assumed that Ted was able to do it because they were no longer bros and friends anymore. The fact that Barney gave Ted verbal permission to hit him "anywhere but the face" may also factor into Ted's possible exemption from the code.
In Barney's flashback to the writing of the Bro Code, the girl on past Barney's left is wearing a dress from the episode "Halloween" from the show Buffy the Vampire Slayer, which Alyson Hannigan also starred in.
This episode shares many similarities with Tick Tick Tick. Both episodes begin with Barney and Robin lying in bed together following on from a kiss at the end of the previous episode (Sandcastles in the Sand and Disaster Averted ). In both episodes they try to pretend it never happened but Barney is so nervous he almost slips up. Similarly in both episodes it is Barney who gets the rawer end of the deal. In this episode, Ted forgives Robin but refuses to forgive Barney, ending their friendship. In Tick Tick Tick, after agreeing to break up with their perspective partners so that they can be together, Barney breaks up with Nora but Robin stays with Kevin, leaving Barney heartbroken. Also the proceeding episodes' titles are similar: This episode is proceeded by Rebound Bro and Tick Tick Tick is proceeded by The Rebound Girl .
When Ranjit yells at Barney at the limo, he says (transliterated Persian) "na mard, na looti, na rafigh; akhe age oon doost dokhtare man bood ke...". Roughly translated, this means: "Inhuman, traitor, non-friend; if she was my ex-girlfriend, I would put my hands around your neck..."