However, there was one term that I heard on a "Simpsons" DVD commentary that I hadn't heard before and that finally put a name to a familiar comedy-writing technique. Al Jean refers to something called the "Stan Daniels Turn." This is named for Stan Daniels, co-creator of "Taxi" and producer of the later seasons of "The Mary Tyler Moore Show." The term refers to a type of joke where someone says one thing, and immediately (but unconsciously) contradicts himself a moment later. The joke is based on the speaker's lack of awareness of the disconnect between the two statements.
Here's a classic example from "The Mary Tyler Moore Show," the episode "Chuckles Bites the Dust" (Daniels didn't write the episode, but he was one of the producers):
(Update: the clip I posted here is gone, so here's the script excerpt.)
(Situation: Ted is upset because Lou won't let him be grand marshal of the circus parade.)
He treats me like a little child,
Mary. He bosses me around as though
I were ten years old.
Ted that isn't true. He may boss you
around but he doesn't think you're a
kid. He respects you as a mature
Then why won't he let me go to the
That's the Stan Daniels turn in its basic form: Ted says that he's upset at being treated like a child, and then, in his very next line, says something that a little child would say. The laugh comes from Ted's lack of self-awareness about this, and from the audience's pleasant surprise at realizing how the joke was set up.
The technique doesn't seem to have been very common, at least on sitcoms, before the '70s, which is presumably why it's named after Daniels (I doubt he invented it, but he seems to have popularized it). A lot of shows have used it since then; the show "Frasier" used it something like twice or three times an episode:
NILES: Well, I wish you'd at least think about it. A candidate like this doesn't come along that often. He's hard-working. He volunteers weekends at a soup kitchen. He really cares about people. Finally, a politician who believes in the things we believe in.
[A young boy approaches with boxes of candy.]
BOY: Buy a box of chocolates -- send a kid to camp?
NILES (angrily): Excuse me, can't you see we're talking here?!
It's kind of a self-aware, almost meta-humorous type of joke, because it's sort of a game between the writer and the audience -- see if they can set up something and find a creative way to contradict it in the very next moment -- and because it often depends on something happening oh-so-conveniently on cue, as in the above joke. When it works, it works really well, though.