A corporate executive, a politician, and a successful entrepreneur walk into a bar....

This might sound like the beginning of the least funny joke in the history of mankind, but according to new research out of Harvard and Wharton, if you think of leadership and humor as antithetical, you're probably holding your career back.

Leadership is serious business, and most of us picture those who excel at it behaving seriously. But a great sense of humor isn't just useful if you want to rise to the top as a comedy writer or late night TV host. It's also a powerful tool for those looking to establish themselves as leaders, the study shows.

Why? The ability to land a good joke is actually a great way to show off your stature and confidence. "If you are brave enough to tell the joke that you want to tell, whether it succeeds or not, people ascribe confidence to you," Harvard Business School professor and study co-author Alison Wood Brooks tells Harvard Gazette.

Plus, she adds, "to tell a successful joke does, in fact, take quite a lot of competence and not just general intelligence, but emotional intelligence."

Should you become the office clown?

Which flags up a very important point about humor at work. It's hard to get right -- very hard -- a fact, the researchers don't dispute. And telling an inappropriate joke can backfire spectacularly.

"Humor can fail because it's inappropriate, because it's just not very funny or because we overdo it. In those cases, we signal low competence and that harms our status. And in some cases we've seen people get fired because of it," Maurice Schweitzer, a Wharton professor who also participated in the research tells Knowledge@Wharton.

But while wildly inappropriate jokes really can kill your career, the research revealed that simply being not all that funny or a little off kilter in your humor won't have such terrible effects. In fact, cracking less-than-hilarious jokes still has benefits.

"What we find is that whether or not the humor goes well, the use of humor, the attempted use, always signals confidence. I'm a confident person, I'm telling a joke," Schweitzer adds. Of course you can be seen as confident but utterly clueless if your quips are bad enough, but there are still upsides to trying.

Break out of "the prison of silence."

Which just might be the bottom line takeaway of the study -- more of us should probably give it a go and let our sense of humor show at the office, though with caution and within limits.

Those at the bottom of the career ladder, "often feel trapped in a prison of silence where they can't make their jokes because they know that it's risky. They know that if they voice their jokes and they don't land, people are going to think they're dumb and inappropriate and unprofessional," says Brooks. "All of that stuff is really damaging."

"Humor can be a really effective tool for increasing status and that people should be aware of this," agrees Wharton doctoral candidate Brad Bitterly, a third researcher involved in the study. You might even want to consider taking improv classes to improve your sense of humor if you feel you're lacking in the area, he suggests.

Want to learn more about what science says about the effects of humor? Here's one study that found using sarcasm actually has professional benefits and a fascinating Quartz article on why psychological health and a good sense of humor usually go together.