Hearing a punch line before the setup will predictably spoil a joke. But what of running gags and callbacks? Often a joke is funnier when it is familiar. An article published online in December 2013 in Cognition and Emotion resolves this paradox by applying research on insight.

Sascha Topolinski, a psychologist at the University of Cologne in Germany, studies processing fluency: when information is absorbed easily, it feels more true and beautiful. Repetition can increase fluency, which is why we prefer familiar music and art. Research also shows that “spoilers” do not always spoil. A 2011 paper in Psychological Science found that subjects who first read summaries of stories later enjoyed those tales more—even mysteries and stories with an ironic twist.

A sudden rise in fluency feels especially good, lending the experience of insight its pleasurable kick. In his studies, Topolinski presented subjects with 30 jokes. But first they saw 15 words—one word from half of the punch lines. Subjects found those 15 jokes funnier than the others. They could not predict the punch lines from the hints, which means the words did not spoil the jokes; they just made the punch lines quicker to process.

Humor is dynamic: “You first get this ‘ugh’ irritating moment, and then ‘ah, I got it,’” Topolinski says. The more fluent the “I got it” moment, the funnier the joke—laughter depends on how fast the resolution pops into your head. In a final study, jokes seemed funnier when the punch line was written in an easy-to-read font. So when telling a joke, try hinting at the punch line before dropping the final bomb. You want your audience laughing, not pausing to scratch their heads.