At some time or another, we have all sat with a friend and heard them come out with a quip we would rather they'd kept to themselves. Whether the remark was too cold, too cruel or simply too revolting, you might have meekly giggled along. Perhaps you glanced down, and quietly thought less of your companion. Or perhaps you plucked up the sort of courage, too rare in England, to tell them what you thought. Whatever you did, it is a fair guess that you didn't pick up the phone to the police with a view to starting criminal proceedings.

Maybe the worst "joke" to have polluted your ear was not as offensive as those posted on Facebook by Matthew Woods, about the missing five-year-old April Jones. It could scarcely have been worse; yet such nastiness is not exceptional in playgrounds or pubs. It is only because this callous sub-comedy happened online that Woods is starting a 12-week prison term. A statute of 2003, which has since been overtaken by the technologies it polices, took a form of bad behaviour previously dealt with through social censure, and criminalised it on the net. That context was then still a novelty, for parliamentarians at least. MPs and peers, who a few years later took a brave stand against Tony Blair's cavalier plans to ban insulting and ridiculing words about religion, probably hazily imagined some freaky Californian practice when they enacted section 127, which barred electronic messages of a "grossly offensive or of an indecent, obscene or menacing character". They certainly would not have thought they were making nasty banter something their constituents would indulge on pain of imprisonment. But that was before Twitter, and before Mark Zuckerberg had created a site that asked users to rate the attractiveness (or lack of it) of his unwitting fellow students. The unsavoury beginnings of the phenomenon that became Facebook underline that social networks are, first and foremost, a new outlet for the old human habit of amoral gossip.

Most of it, of course, is not offensive enough to be affected by the act, but quite a variety of sins can be caught. This very week has also seen the sentencing of Azhar Ahmed in West Yorkshire, for expressing his anger about the war in Afghanistan, by posting on Facebook that soldiers should die and go to hell. He was not convicted because anyone believed he was actually soliciting violence, the traditional restraint on free speech (which, incidentally, proved perfectly adequate for jailing Abu Hamza), but merely because he had caused offence. Previously, there was Paul Chambers' conviction for a jocular threat to blow Robin Hood airport sky high, made while he moaned about expected delays. His successful appeal produced a judgment which emphasised that jokes in poor taste would not ordinarily result in a conviction.

But Woods's guilty plea, made on legal advice, shows how ambiguity lingers. Like the lord chief justice in the Chambers case, the director of public prosecutions, Keir Starmer, is usefully attempting to narrow the circumstances in which the law will be applied – using his decision not to pursue a homophobic tweet from footballer Daniel Thomas as occasion to consult on guidelines about when charges should be pressed.

The DPP has sensible first thoughts on where charges should be more likely – hostile tweets or posts that, for instance, victimise, exhibit racism, or amount to a credible threat. But he is properly at pains to stress that he can only implement the law as it is written. It is hard to imagine any guidelines that will remove the controversy, however. Should Martin Amis, for instance, have tweeted his confessions about an urge for Muslims to suffer rather than communicating it in other ways, would he, too, have been prosecuted? Should he have been? The obvious answer ought to be no, but it is not obvious from fuzzy legislation which powerless angry young men like Ahmed have every right to believe will instead be applied unfairly against them. In the end the solution will have to be rewriting or even repealing, as opposed to reinterpreting, this law.