At the end of the month, President Obama will deliver a string of punch lines at the White House Correspondents' Dinner. It's an annual tradition, a chance for the man at the top of the pyramid to poke fun at his political opponents and himself.

Humor is an essential tool in any politician's kit — all the more so in an age of instant, constant media. It can disarm an opponent, woo a skeptical voter or pierce an argument. This year, both Obama and presumptive GOP nominee Mitt Romney are using it to try to win the upper hand in the presidential race.

So far in this campaign, Obama and Romney have been the butt of a lot more jokes than they've made themselves. Anyone in the White House is a nightly source of material for comedians of all kinds. Romney, meanwhile, has been mocked for saying the trees in Michigan are the right height, and for telling Mississippi voters that he learned to say "y'all."

Romney has been trying to reverse his reputation as a humorless aristocrat. When he stiffly told CNN last December, "I live for laughter," the line had the opposite effect, reinforcing his buttoned-up image.

And when he cited his comedic preferences in that same interview, "Laurel and Hardy, the Three Stooges, even the Keystone Kops," the examples were not exactly the laugh track of 2012.

Yet occasionally, a genuinely funny side of Romney slips out. At the end of a particularly bad day campaigning in Michigan, the candidate seemed a bit slap-happy when he took the stage at Western Michigan University in Kalamazoo. He talked about driving through the town of Brighton, where his parents are buried.

"My dad is a very frugal man, and he checked all over for where the best deal was on a gravesite," Romney told the audience. Sounding incredulous at his family's quirks, he wrapped up the story with this advice: "If you're looking for the best deal on a gravesite, check Brighton. They've got a good spot. And you're near the former governor and former first lady!"

It was a human moment that endeared Romney to his audience. That is the most valuable use of humor in politics, says former White House speechwriter Landon Parvin. "If you can make fun of yourself, it says that I'm just like you."

Parvin has written speeches for the last three Republican presidents, and he is known for his comedy. He says the connective power of humor could be especially important this year. Each candidate is trying to portray the other as an out-of-touch elitist who doesn't understand the American people. A joke shared with an audience can serve as anti-venom. It's a way of telling voters, "We get each other."

Parvin thinks both men are missing opportunities to forge these kinds of connections. "Neither of the candidates that I see are using genial, good-natured humor," he says. "What I've seen on the campaign so far is the insult and the cut."

The cut can serve a purpose too, says former Obama speechwriter Jon Lovett, who's now writing a sitcom for NBC.

"If you can make someone laugh about something that your opponent or your opposition thinks, that means you've done a really good job of highlighting what's wrong with their argument or their position," says Lovett.

He points to an immigration speech that President Obama delivered on the Texas border last May. The president argued that every time he met Republican demands, the Republicans moved the goalposts.

"They said we needed to triple the border patrol," Obama said. "Well now they're gonna say we need to quadruple the border patrol. Or they'll want a higher fence. Maybe they'll need a moat. Maybe they want alligators in the moat!"

Most of that speech was a rehash of arguments the president had made before. But thanks to the joke about alligators, the speech was all over the news.

"So not only is it about having that connection with an audience; it's also about figuring out ways to bust through a culture of politics and media that makes conveying substantive arguments so difficult," says Lovett.

That media culture makes humor in politics more valuable now than it has ever been, says communications professor John Meyer of the University of Southern Mississippi.

"I think the more we have had media involved in our presidential campaigns, the more humor has become a force for presidents to use both in becoming elected and in becoming an effective president," says Meyer.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.