Taking on the media is never a good idea if you happen to be a member of the judiciary.

While judges are required to be fair, logical and impartial, reporters and commentators are often inaccurate, opinionated and driven more by commercial needs than by lofty ideals.

That much seems well understood by the Lord Chief Justice, Lord Judge, who is currently discouraging his senior colleagues from giving media interviews on sensitive topics.

But he seems to have felt the need to make up for this judicial reticence by agreeing to give off-the-cuff responses to media questions last Friday at the launch of Lord Neuberger’s report on super-injunctions.

This was a measured and sensible report, apparently drafted by John Sorabji, legal secretary to the master of the rolls, and printed on recycled, austerity-style paper to show how frugal the judges now are.

And the two senior judges might have assumed that media organisations would have welcomed the report’s conclusion that restrictions on the media’s right to report court hearings should be allowed only when strictly necessary.

But that assumption ignores two media imperatives.

First, the newspapers’ commercial interests are best served if there are no restrictions at all.

Second, a story along the lines of ‘judges agree that newspapers should be allowed to publish quite a lot really’ won’t attract many readers.

So, reporters looked around for a conflict to generate, settling first on the idea of a row between the judges and parliament.

It looked a promising source of disharmony.

Only a day earlier, the recently ennobled Lib Dem peer Lord Stoneham had used parliamentary privilege to complain that a ‘super-injunction’ had been used to hide ‘the alleged relationship between Sir Fred Goodwin and a senior colleague’, this allowing the nature of the injuncted information to be reported for the first time.

Stoneham was wrong, of course.

As the Neuberger committee patiently explained, a super-injunction is one that bans reporting of its very existence; there were never any restrictions on reporting the Goodwin injunction or the judge’s reasons for granting it, provided the former RBS boss was not identified as the person who had obtained it.

Asked for a quote, the lord chief justice told reporters dryly that it was ‘wonderful’ for them if an MP or peer stood up in parliament and breached a court order on anonymity.

‘But you do need to think,’ Judge continued, ‘whether it is a very good idea for our law-makers to be, in effect, flouting a court order just because they disagree with the order — or, for that matter, because they disagree with the law of privacy which parliament has created.’

Quite right, of course, but perhaps not the most tactful thing that Judge could have said.

The media’s second line of attack involved Twitter.

I had asked Neuberger why newspapers should respect injunctions that were widely flouted on the internet.

The master of the rolls accepted that this was a problem for the print media.

It was Judge, though, who allowed his frustrations to show through.

‘Modern technology is totally out of control,’ he said. ‘Anybody can put anything on it.’

Again, true; but inconsistent with the lord chief’s warning that ‘people who, in effect, peddle lies about others by using modern technology may one day be brought under control.’

The real problem is that Judge allowed himself to be portrayed as someone with a personal interest in restricting freedom of speech.

That’s not the case, of course, but the newspapers seem to have got it into their heads that every victory for the press in getting the terms of an injunction relaxed is a defeat for the judiciary.

By the start of this week, it had all got a whole lot worse.

First, a Scottish Sunday newspaper identified Ryan Giggs as the married footballer who had been granted an anonymised injunction banning media reports of his alleged relationship with Imogen Thomas, described as a ‘reality TV star’.

Next, just as Judge had predicted, an MP decided to name Giggs in the Commons. One by one, the mainstream media organisations decided that they were safe to use the footballer’s name.

By then, it might have been wise for the courts to have lifted the court order.

But Mr Justice Tugendhat concluded that the injunction was needed, more than ever, to protect the claimant and his family from intrusion into their private and family life.

That might be true, but allowing Giggs to be identified could not have made matters much worse for him.

Maintaining the injunction also gave the newspapers an excuse to depict the judges as out of touch.

John Hemming’s identification of Giggs came in response to an announcement by the Attorney General, Dominic Grieve, that a joint parliamentary committee would be established to advise the government on how ‘current arrangements can be improved’.

This could mean anything.

Instead, parliament should decide whether footballers and other entertainers who cheat on their wives may have their names kept out of the newspapers.

My own view is that we are too generous to these people, although I can see stronger arguments if blackmail is involved.

I am not impressed by the argument that privacy is necessary to protect miscreants’ children: you can’t claim anonymity if you are convicted of murder, rape or getting your wife to take your penalty points.

Privacy is a fundamental right and deserves to be respected. So does freedom of expression.

But the judges would benefit from some parliamentary guidance on where to draw the line.