Why the 'How I Met Your Mother' finale twist had to happen

The "How I Met Your Mother" finale twist was nine years in the making.

Final farewell: The cast of "How I Met Your Mother" gathered for a panel discussion at last summer's ComicCon. Credit Getty Images

It's over. Nine years of Ted recounting the story of meeting his children's mother, and last night he finally did — and "How I Met Your Mother" turned out not to be about her at all.

Spoiler alert if you haven't seen last night's series finale (and how big of an accomplishment is it that people care about spoilers for a sitcom with a laugh track?): Ted and the mother fell in love, had kids, got married — and then she died. In the end, it was Ted's kids who encouraged him to go after his first love: Robin Scherbatsky, who was by then divorced from Barney.

I know, WTF, right? Even hardcore fans were scratching their heads a bit at how the show undid all its careful work selling us on Barney and Robin's relationship. But really, it had no choice. Remember, it's been nine years: The actors playing those kids are in their 20s now. The footage we saw of them was shot early in Season One.

“They had actually planned the ending during our pilot,” Cobie Smulders (Robin) revealed to David Letterman last night. “They shot some scenes with the two children … who are now in their mid-20s. It’s kind of amazing that it’s been nine years, and it’s come full circle.”

That's an impressive commitment to storytelling. I really admire that kind of forethought. Unfortunately, the show's creators couldn't know that, over nine years, Barney and Robin's relationship would become so much more interesting. They should have spent those nine years inventing a time machine.