Sure, news of final seasons for "The Office" and "30 Rock" is bittersweet. But it's better to quit before jumping that shark.

Receive the latest television updates in your inbox

Steve Carell is gone, but "The Office" is getting ready to say goodbye.

By the time the final episode of “The Office” airs this spring, we’ll be nearing the 20th anniversary of the end of “Cheers” and marking 15 years since the “Seinfeld” finale. The impending closing of “The Office,” like its classic sitcom predecessors in the anchor spot of NBC’s Thursday night comedy line-up, probably will spur increasing hoopla and a certain sadness as the final laughs draw near.

But the three shows also soon will share another important distinction: Ending their runs while they’re still near the top of their game.

Sure, news that “The Office” is joining “30 Rock” in calling it quits after the upcoming season is bittersweet. But we’re glad they’re quitting before jumping that shark.

The expression “jumping the shark,” of course, stems from “Happy Days,” which spent the last few of its 11 seasons trying ride the wave past greatness. But the show never quite recovered from Fonzie’s embarrassing leap over what turned out to be an idea chasm. The same was true, in a less flashy fashion, for “All in the Family,” which, after nine seasons tried to extend the magic of perhaps American comedy’s best-written sitcom (at least for the first five or so seasons) with four years of the mediocre semi-spinoff “Archie Bunker’s Place,” which is best (or worst) remembered for killing off Edith.

Bad endings – often the product of sticking around too long – too threaten to mar the memories of what was. Even if “Cheers” wasn’t as strong in Season 11 as Season 1, it still had plenty of life left. But barkeep Sam Malone, no genius, was smart enough to stick to his quitting time, delivering a classic final line to a would-be customer, lurking in a shadows outside Cheers’ door: “Sorry, we’re closed.” Mary Tyler Moore, whose 1970s show set the standard for the ensemble sitcom, also established the benchmark for classy, leave-on-top finales, with the moveable group hug to a sing-a-long of “It’s a Long Way to Tipperary.”

We have no idea how “30 Rock,” the closest current relative to “The Mary Tyler Moore Show” (Liz = Mary, Pete = Murray, Jack = Lou, Tracy + Jenna = Ted), will end its seventh and final season, which will consist of 13 episodes capped by an hour-long finale. We also don’t know how “30 Rock” made it past Season 1, which is not a criticism but a statement of admiration and astonishment.

The show is a breathless, laugh-a-minute comedy high-wire act, brilliantly executed, with part of the thrill watching the writers and cast pull it off week after week. “30 Rock” is coming off one of its strongest seasons – highlighted by a live show that was even better than the funny first attempt 18 months earlier. But with Tina Fey’s Liz Lemon showing new signs last season of pining for a baby (adding a new kid is a sign a sitcom is running out of steam, as we saw with “Family Ties” and “The Cosby Show,” among others), this seems as good a time as any to bow out – even if any possible pregnancy plot likely will be far more irreverent than mushy. Besides, Alec Baldwin’s vow to leave no matter what after this season makes the parting easier – it’s difficult to imagine that comedy engine running sans the blustery fuel of his Jack Donaghy.

Still, “The Office” proved it could survive the loss of a main character, joining “MASH” and “Cheers” in that rare pantheon. Last year’s first Michael Scott-free season got off to an uneven start, relying too much on tiresome Jim-and-Dwight bickering. But the episodes grew stronger as with Ed Helms’ Andy Bernard transforming from a milquetoast to guy who put the “man” in manager amid the mind-games played by James Spader’s inscrutable BS artist Robert California and Catherine Tate’s unhinged New Age corporate shark, Nellie Bertram, who is expected to return for the finale season. Spader, though, won’t be back, nor will Paul Lieberstein (Toby) and Mindy Kaling (Kelly).

We’ll see whether Steve Carell, who was smart enough to quit while he was ahead, will return for “The Office” finale. But part of us hopes Michael Scott stays away – his Season 7 sendoff was note perfect, ending on a silent mouthing of his catchphrase, “That’s what she said.” We can only wish similarly appropriate good-byes for “30 Rock” and the rest of “The Office” cast as they hopefully leave us with unsullied memories of great shows, a giant leap ahead of that shark.