There has never been a consensus on how anonymity for suspects and victims in criminal proceedings should work in practice.

Two recent, widely reported cases – the dropped investigation into Sir Cliff Richard, and the two lawyers arrested following a sexual encounter outside Waterloo station – have illustrated the shortcomings and reignited the debate on both sides.

Currently, suspects have no right to anonymity. While Lord Justice Leveson and the College of Policing have both said that suspects should only be named at the pre-charge stage in exceptional circumstances, the reality is different. Suspects are routinely named before charging decisions, and not always because their identities are released by investigators. Journalists often use other sources.

One solution is a prohibition on naming suspects before charge, save in exceptional circumstances sanctioned by a court. Last year the Commons home affairs select committee called for a statutory ban concerning the naming of sexual offence suspects, but is this limitation justified? Should we give priority to the rights only of those accused of sexual offences when allegations of other offences can be equally destructive?

For victims, the Sexual Offences (Amendment) Act 1992 provides lifelong protection against being identified in the media. While this may seem a justified restriction on press freedom, the Waterloo case shows that even this can be controversial.

In August last year a male solicitor and female QC were charged with outraging public decency following an apparent drunken public encounter. The QC accepted a caution but later reported the activity had not been consensual. The immediate consequence was that she received automatic anonymity as the person cautioned for outraging public decency.

The conviction in March of the former Sun editor David Dinsmore, for publishing a photograph of Adam Johnson’s teenage victim, is a good example of the challenge faced by the media. Although the image had been heavily pixelated, it could apparently be identified by those who had seen the original Facebook photograph, and Dinsmore was found guilty.

While there is no excuse for reckless journalism, is the law sufficiently certain to provide the freedom necessary to report on matters of public interest without fear of prosecution? Where naming suspects is concerned, controls are necessary to protect those who may never be charged. The most effective means would be a complete ban on naming suspects without a court’s approval.

For complainants, the law is a halfway house. If it is intended that no identifying details – no matter how obscure or obscured – should be published, the law should clearly say so. However, if it is recognised that there can be legitimate public interest, and that a free press needs the freedom to make mistakes, then the law should stand up for that principle.

One thing is certain: the current position is unsatisfactory.