In response to the vile murder of a British soldier by two Islamist extremists armed with meat cleavers, the home secretary, Theresa May, has suggested a broadcasting ban on people who hold "disgusting views" and the pre-censorship of online hate speech. We face a real threat of violence here, as do other European countries. Another Islamist extremist was arrested in France and has admitted to stabbing a French soldier. But this is not the way to reduce that threat. What May proposes is impractical, illiberal, short-sighted and counter-productive. It would curb a vital freedom without enhancing our security. Her suggestion should be consigned to the dustbin of hysteria.

Incitement to violence is a criminal offence in all liberal jurisdictions, including our own. Our lawmakers and judges need to keep under constant review what, in the transformed circumstances of the internet age, constitutes such incitement. But generalised pre-censorship of "disgusting views" at the behest of an interior minister would start us down a very slippery slope.

To entrust our freedom of expression to the Home Office is like putting your aching tooth in the tender care of a road-mender wielding a waist-high pneumatic drill. This is the same department that, under a Labour home secretary, arbitrarily banned a whole list of people from entering this country because they would "foster extremist views". The list included the US radio host Michael Savage. As if the nation of John Milton and John Stuart Mill were incapable of seeing through and seeing off some crude, ranting shock jock by the strength of our own wits and the vigour of our own language.

The home secretary will reply that she wants to place the blocking duty not with her own bureaucratic enforcers but with Ofcom, the public regulator of broadcasting. Ofcom already has considerable powers to sanction broadcasters who violate its carefully drawn editorial standards, and it uses those powers independently, scrupulously and well. But now a state regulator is to pre-censor editorial content, at the bidding of an interior minister, in the name of defending public security and fighting terrorism? Where we have seen that before? Egypt. China. Russia. Welcome to the club. And this, by the way, from a Conservative party so frightened of our press barons that it continues to let them ravage the private lives of ordinary, innocent Britons, in the interest solely of prurience for profit – most recently, contributing to the suicide of a sex-change schoolteacher who was exposed to what a coroner called "character assassination" in the popular press – without even the minimal structure of press regulation that is plainly needed.

May's proposed ban is impractical. If it didn't work in the 1980s, when Margaret Thatcher tried to stop Sinn Féin/IRA spokespeople breathing the "oxygen of publicity" on terrestrial television, how much less will it work today – when publicity-hungry Islamist provocateurs like Anjem Choudary can just go off and post their videos on YouTube. So, says our knee-jerk home secretary, we should consider getting Google and YouTube, as well as the broadcasters, to block such footage in advance. Now not everything that Google does is good, whether on tax, competition or privacy, but to impose on it the editorial obligation to pre-screen everything going up on YouTube would destroy something incredibly valuable: an unprecedented ability to speak directly to one another, across oceans and continents.

Moreover, censorship would be counter-productive. Jack Straw, a former Labour home secretary, says the 1980s partial ban on Sinn Féin/IRA spokespeople (whose statements were, ludicrously, voiced over by actors) was "a great recruiting sergeant for them". So it would be for today's venomous extremists. They would like nothing more than to be banned. They are gagging to be gagged. Then they can pose as martyrs – martyrs of the Islamophobic west, martyrs for free speech.

No, the way to fight these preachers of violent extremism is not to ban them but to take them on, in every medium. Editorial judgments must be made – by editors, not by interior ministers. I think the BBC and Channel 4 are probably wrong to have media-savvy extremists like Choudary on screen in formats that in any way suggest they might be legitimate participants in a civilised national debate. It would, however, be absolutely right for journalists to film and interview him as part of an investigative report on how a young British-born man came to be convinced that he should butcher a British soldier in the name of Allah. The London-based Institute for Strategic Dialogue has started some interesting work on how you can counter extremist narratives online with other online narratives and tools.

Finally, in the footsteps of Edmund Burke, I want to put in a good word for hate. It is as foolish and futile to try to criminalise a whole emotion as it is to aspire to defeat one in a war. (The "war on terror".) Moreover, as that great British Conservative thinker pointed out, some hate is healthy. "They will never love where they ought to love," wrote Burke, "who do not hate where they ought to hate." I hate the violent Islamist ideology that poisoned that young man's mind. I hate fascism. I hate oppression of all kinds. I hate humbug. I hate sloppy thinking. And, in the cause of these good hatreds, I warn against the superficial, short-sighted, counter-productive "something must be done" knee-jerk reactions of home secretaries who end up eroding our freedom in the name of defending it.

• Comments on this thread will be premoderated for legal reasons

• Twitter: @fromTGA