In recent years, more and more comedians have landed in strife over provocative humour. Think Dave Chappelle's jokes at the expense of the trans community … or Louis CK's, for that matter.

They said what?

Jimmy Carr, 2014: Complaining about a toilet queue the British comedian said, "All I'm saying is I can see it from Oscar Pistorius' point of view … I blame her [Reeva Steenkamp, who was shot dead by Pistorius]. If she hadn't been in that disabled toilet none of this would have happened."

Ricky Gervais, 2018: In the Netflix special Humanity, Gervais referred to Caitlyn Jenner as a "big strong man", used her pre-transition name and compared gender dysphoria to a human identifying as a chimpanzee.

So, where's the line between controversial comedy that has us in stitches and the kind that deserves condemnation?

Some comedians believe there are limits to who can joke about what, but others say that if we value freedom of speech, no topic should be taboo.

This week, in our pop culture and ethics series It's Complicated, we're exploring the grey zones of comedy. We've chatted to comedians, cultural studies experts and a philosopher to figure out:

Should comedians strive to "punch up", not down?

Why are some jokes "off limits"? Is it about identity of the joke teller or the butt of the joke?

How come Plato and other philosophers were anti-comedy?

When we laugh at an offensive joke, are we endorsing its sentiment?

Let's jump into it.

Why laughter can be a weapon

From the mundane to self-deprecating, insulting to absurd, comedy, in all its forms, builds communities around laughter.

For many, it's a bonding experience, a joyful, much-needed release.

But depending on the type of comedy, that release can come at others' expense.

Jessica Milner Davis is the coordinator of the Australasian Humour Studies Network and an honorary associate at the University of Sydney. She says humour is a bit like nuclear power.

"You can use it for good or you can use it aggressively to hurt people," she points out.

Here, Dr Milner Davis has a surprising take. She believes the latter category — humour that hurts people — can actually yield a positive effect.

"Within a small group, joking about people outside that group actually has a very bonding effect, [it] brings people together," she says.

Image Comic Amy Schumer, who is popular with female audiences, uses comedy to call out male politicians legislating over women's bodies.(Facebook: Amy Schumer)

"That's an example of humour being used for a bad purpose, but even in that bad purpose there is also a good purpose, there is a bonding which can be useful."

When privileged groups in society use comedy to attack marginalised voices — think Gervais making jokes about trans people — the hurt can have more damaging impacts.

Sarah Ilott, a senior lecturer in English and film at Manchester Metropolitan University and co-author of Comedy and the Politics of Representation: Mocking the Weak says laughter has been used as a weapon for thousands of years.

"If the joke is, for example, racist, homophobic or transphobic, by sharing in laughter you're constructing a community that excludes those who are the butt of the joke," she says.

"If they were also present at the film screening or at the comedy gig, they [could] feel increasingly marginalised."

Image Candy Bowers toured Victoria and Tasmania recently with her stage show Australian Booty.(Supplied: Sean Young)

As a woman of colour, Sydney-based writer, comedian and director Candy Bowers has experienced this marginalisation from the perspective of punter and performer.

She says comedians need to take responsibility for the harm their humour can cause, particularly when vulnerable groups are involved.

"I don't think any sort of material is out of bounds, but it has to be approached with a level of cultural safety and intellect," she says.

"There's a narrative going around that 'safety' means the subjects aren't edgy or deep or rich or sexy, but that's not true.

"Cultural safety means I can take any of my disabled friends or any of my black friends or queer friends or people who are marginalised to any of these shows and not walk away going, 'Once again I was the butt of 50 per cent of the jokes.'"

Stand-up, punch down

In the comedy scene, 'punching up' and 'punching down' are two common terms of reference.

The first approach applies to jokes targeting the social elite — politicians, stockbrokers, entrepreneurs and other privileged communities.

'Punching-down' humour takes aim at those who are — or have traditionally been — socially, culturally, financially or racially disadvantaged.

According to Luvell Anderson, assistant professor of philosophy at Syracuse University in New York, entertainers have satirised vulnerable groups for hundreds of years.

In December last year, audio from a Louis CK stand-up set was leaked. The routine was one of CK's first public appearances since allegations of sexual harassment were levelled against him. It contained quips about the Parkland shooting survivors, transgender youth and people with disabilities — and was widely condemned.

Shah says the jokes weren't any "more or less horrific" than some of CK's earlier stand-up — hence, it's not the content, but the context that has changed.

"We used to hail [CK] as brilliant for his ability to go to dark places, to say things that are hilariously absurd and grotesque," he explains.

"We used to trust him as an individual and go, 'His heart's in the right place … and therefore, when he says these things we know it's not coming from a place of malice, we know it's coming from a place of comedy' — and that's where the context lay.

"Now, we don't consider Louis CK to be as empathetic, trustworthy or considerate a person, and therefore when he goes back to the same places, he doesn't have the credibility to go there anymore."

Asking for a friend: Am I a bigot?

CK's career has undeniably taken a hit, but there are plenty of other comedians still making questionable content.

Australia's own Chris Lilley is one such figure. Streaming service Netflix released his 10-part mockumentary series Lunatics last month. Following in the vein of Summer Heights High and Jonah from Tonga, it sees Lilley shapeshifting between genders, races and bodies of varying ability.

Some critics have praised the series, others have called out what look's like Lilley's reprisal of blackface and questioned whether the performer was ever funny in the first place. So, where should we draw the line?

"What is the purpose of humour? Is it to cure all social ills or is it to amuse and entertain?" she asks.

"Do we think that Chris [Lilley] should not play women, should not play coloured people, disabled people, so forth?

"He does it with enormous skill and with grace and with dignity."

Bowers has very different views.

"You can love what you love, but also own who you are," she says.

"If you love a show, like Chris Lilley's show, know you love it 'cause you're racist — you like white people making fun of people of colour. You're ableist — you like people with disability being made fun of.

To laugh, or not to laugh?

So, does our laughter endorse the sentiment of a joke? That decision is ultimately up to you.

For some, it's entirely possible to find sexist and racist jokes funny, and to condemn sexism and racism on the whole. For others, even a chuckle equates to approval.

"Audiences are increasingly acting with their feet, calling out comedians for offensive material and refusing to endorse the ideology implicit in joking through laughter or even through attendance," says Dr Ilott.