This week I went to the Royal Courts of Justice to offer support to someone who is in a lot of trouble because of a not particularly funny joke. As an erstwhile pedlar of some not particularly funny jokes (just ask the Guardian's comedy critic, he doesn't dig what I do at all), this matters to me a great deal.

As you walk into the Royal Courts of Justice, you are supposed to be awed by this Victorian legal cathedral, and I suppose you might be if the reason for you being there were not so ridiculous. Paul Chambers, who completely fits the "regular guy" bill, is in court to appeal against a conviction that stemmed from the law having one of its periodic Monty Python-does-Kafka brainfarts. I've never read any Kafka, by the way; maybe I should, and then I'd be as clever as genuflectee Stewart Lee.

In a fit of frustration at his flight being delayed by snow, Paul tweeted this message – and hold onto your hats, this one's all zinger – "Crap! Robin Hood airport is closed. You've got a week and a bit to get your shit together otherwise I'm blowing the airport sky high!!" It's not brilliant, but I'd say it has many hallmarks of the humorous remark – it starts with a mild profanity, leans heavily on exclamation marks, and has a pathetic threat at its heart. Would anyone who was not joking but actually issuing a threat give an airport "a week and a bit"?

This got Paul a conviction for "sending a public electronic message that was grossly offensive or of an indecent, obscene or menacing character contrary to the Communications Act 2003". He lost his job; his life has been pretty much kind of ruined.

Lots of people, including platinum tweeter Stephen Fry, have rallied round to support Paul's right to banter of varying quality. Graham Linehan, writer of Father Ted, The IT Crowd and recent West End smash hit The Ladykillers has been deeply involved, a master absurdist in a state of bewilderment at the real thing – his face in court is a mask of disbelief.

On Wednesday, in my new-found role as court reporter, I heard Paul's QC argue that only a "halfwit" wouldn't see that this was a joke. There was, as they say, laughter in court. But the fundamental problem was that the law don't do funny. Not when there's "menace" around. It does do obscene, and views obscene objectively (though that shifts, obviously, or we'd still be banning a glimpse of ankle rather than browsing endless anal). I did what I could to keep up with the flow of the legal argument and various examples of precedent. Where it seemed to be heading was this: context isn't enough, if you're going to make a joke, make sure that you make it clear that a joke's a joke – if you make it clear that a joke is a joke, then it is a joke. So, when saying something you regard as a joke, in order to avoid loss of job and life ruination, say "joke!".

Now, there are people who do this. We know who they are. They are the people with no sense of humour. There is every chance some of them may be lawyers: joke! But not saying "joke!" is a serious business. This week the Sun told the story of a Labour aide called Matt Zarb-Cousin who had tweeted that the Queen was a "benefits scrounger". A Tory MP who has nothing better to do than be a colossal prick ("joke!") pointed his outrage cannons at Mr Zarb-Cousin, saying: "This is a shameful slur against the Queen." Boom! The trouble is he didn't then say "joke!" himself, because he was being serious. Naming this MP would be unfair, as no one really needs to make a monumental tit of themselves twice in one week ("joke!"), and it would get him in the paper again. Mr Zarb-Cousin took a break from sharpening his guillotine ("joke!") and ended up backing down, buckling under the pressure from one jumped-up arse-clown ("joke!"): "To clarify earlier comments about the Queen: it was a joke & wasn't meant to be taken literally. I didn't mean to cause offence & apologise." For Chrissakes.

It seems that at the centre of this is Twitter, which some people, some of them possibly judges ("joke!"), don't really understand at all. I'm on Twitter, and have tons of followers, and I don't know that I really understand it. I don't understand why people will tweet me, calling me a bald cunt, usually confusing "you're" with "your", and then get all huffy and surprised when I point out it's "you're", and that I'm not bald.

It's probably a joke. I don't find it funny. But that's OK. Because this is the thing about comedy – we can't all have the same sense of humour. But to find out what Twitter is, I asked the people who follow me, and got a wide variety of replies.

Someone calling herself Comtesse Plume said this: "I think the widely used term is 'micro blogging site' personally I'd go for 'verbal diahorroea(sp?) social networking'!" Sheffield Andy answered my question with one of his own: "What is Twitter? Is it a tool whereby you can publicly broadcast serious terror threats? #Twitterjoketrial #Iwillkillagain." (those things with hashes are his way of saying "joke!").

But actually, it isn't about Twitter at all. Twitter and poor Paul Chambers are caught in a crossfire of pisspoor Blairite terror legislation ("not a joke!"), a bureaucratic tendency to timewaste and the speed of technological change brought about by the internet. Add to this a feeble-minded sense of humour failure, a failure to realise that not finding something funny is not the same thing as being offended, and that being offended is not the same thing as having an actual opinion, and that a metaphor born of frustration – "Crap! Robin Hood airport is closed. You've got a week and a bit to get your shit together otherwise I'm blowing the airport sky high!!" – is not a terror threat. Even having to point that out is wearying, bewildering, soul-sapping.

I'm off to read Kafka ("joke!").

Why the law is an old-fashioned ass over social media

Shortly after the Japanese tsunami last March, American comedian Gilbert Gottfried tweeted: "Japan is really advanced. They don't go to the beach. The beach comes to them." As a result, Gottfried was fired from his lucrative role voicing a duck on TV ads for US insurer Aflac, which, unfortunately for him, does 75% of its business with Japan.

Paul Chambers has suffered more for his now-infamous bad Twitter joke. His case has become a benchmark for what can legitimately be said on social media, and a cause célèbre among comedians who argue their livelihoods depend on being able to tell bad jokes without fear or favour. After Chambers' arrest, 4,000 Twitter users re-tweeted his message but none was arrested, thereby, they claimed, highlighting the law's absurdity in this area.

Sitcom writer Graham Linehan, who supports Chambers' appeal, says: "There was another case of two guys who got tried for tweeting something like, 'Let's go to Curry's and pick up a TV'. And the judge said, 'You're both idiots', but didn't convict them. Where's the consistency? They get off and Paul's life is destroyed. It wasn't a threat, or a hoax. It was one guy who didn't realise he was making a bad joke that would ruin his life. That's totally unfair." Linehan argues that instead of arresting Chambers "a policeman on Twitter should have written to him saying 'Listen, mate, I know you're only joking but can you take that down?'

The judges' appeal ruling is awaited with trepidation by Linehan. "I don't want to insult the people deciding Paul's future but I wish they would get a young relative to take them through Twitter and explain what it's about. Lots of people tweet things like 'I'll kill that woman' or 'I'll bomb something'. Most of the time they're not to be taken seriously."

The issue isn't always clear-cut. Gareth Crompton, after hearing Independent columnist Yasmin Alibhai-Brown on the radio criticising David Cameron, tweeted: "Can someone please stone Yasmin Alibhai-Brown to death? I shan't tell Amnesty if you don't. It would be a blessing, really."

Crompton, a 39-year-old barrister, was widely criticised for this message, but tweeted in response: "Who could possibly think it was serious?" The police did. They arrested him under the same legislation used against Chambers.

Was Crompton's tweet really menacing? Alibhai-Brown thought so. She wrote in the Independent: "There are a lot of very violent people out there and they think they have the right to threaten me. This guy has made it OK."

Chambers' appeal comes in a week of growing worries about what can be said on Twitter. BBC rules announced on Wednesday mean its journalists can't break news stories on Twitter before they tell their newsroom colleagues, while Sky News on Tuesday told its journalists not to re-post information from Twitter users who aren't Sky employees.

On Monday Labour researcher Matt Zarb-Cousin's tweet, "Congratulations this morning to Queen Elizabeth II, 60 years of scrounging benefits off the taxpayer without being caught", prompted an apology. And last month Leigh van Bryan, 26, and Emily Bunting, 24, were treated as terrorists by Homeland Security officials in LA. Ryan had been put on an official terror watch database because of two tweets he sent. One read: "@MelissaxWalton free this week for a quick gossip/prep before I go and destroy America?". The other, sent by Ryan, an Irishman living in Coventry, to his Birmingham-based girlfriend Bunting read: "3 weeks today, we're totally in LA pissing people off on Hollywood Blvd and diggin' Marilyn Monroe up!"

The couple were arrested at the airport while agents searched their bags fruitlessly to find spades for disinterring Monroe's corpse, and jailed for 12 hours before being flown home. "We just wanted to have a good time on holiday," said Bunting. "That was all Leigh meant in his tweets."

Their ruined holiday had two droll consequences. One: puzzled American news reports tried to explain bizarre British slang wherein "destroy America" means "party in America". Two: the "diggin' Marilyn Monroe up" tweet was reported to be a reference to a gag on US cartoon series Family Guy, prompting frenetic online activity to find out in which of the show's 176 episodes that "joke" appeared – so far unsuccessfully.

For Linehan such cases highlight official ignorance about social media. "We are at a stage in society where one level understands social networking and then there are people who control the gears of society who don't get it. All the laws on this are from a pre-internet world."

Stuart Jeffries