As Swedish prosecutors' sex-crime allegations against Julian Assange play out, one aspect of the case merits serious scrutiny. We know Assange, the founder of WikiLeaks, by name. But his two accusers are consistently identified only as "Miss A" and "Miss W" in the media, and their images are blurred. In the UK it is against the law to name an accuser in a sex-crime case once a complaint has been made; elsewhere – in the US, and much of Europe – media convention demands that accusers get the same protection. This is bad law and bad policy. Motivated by good intentions, the outcome harms women.

The convention of shielding rape accusers is a relic of the Victorian era, when rape and other sex crimes were being codified in what descended to us as modern law. Rape was seen as "the fate worse than death", rendering women – supposed to be virgins until marriage – "damaged goods". The practice of not naming rape victims took hold for this reason.

Borrowing from a poem by Coventry Patmore, Virginia Woolf labelled the ideal of womanhood in this period "the Angel in the House": a retiring creature who could not withstand the rigours of the public arena. "Good" women's ostensible fragility and sexual purity was used to exclude them from influencing outcomes that affected their destinies. For example, women could not fully participate in legal proceedings. Indeed, suffragists fought for the right to be found guilty of one's own crimes.

Nonetheless, even after women gained legal rights – and as other assumptions about women went the way of whalebone stays – the convention of not naming women who make sex-crime allegations remains. Not only is this convention condescending, but it makes rape prosecutions more difficult.

Anonymity serves institutions that do not want to prosecute rapists. In the US military, for instance, the shielding of accusers' identities allows officials to evade responsibility for transparent reporting of assaults – and thus not to prosecute sex crimes systematically. The same is true with universities. My alma mater, Yale, used anonymity to sweep incidents under the carpet for two decades. Charges made anonymously are not taken as seriously as charges brought in public.

It is only when victims have waived their anonymity – a difficult, often painful thing to do – that institutions change. It was Anita Hill's decision in 1991 not to make anonymous accusations against Clarence Thomas, now a US supreme court justice, that spurred a wave of enforcement of equal opportunity law. Hill knew that her motives would be questioned. But as a lawyer she understood how unethical anonymous allegations are, and how unlikely to bring about change.

The convention of anonymity, conversely, lets rape myths flourish. When accusers are identified, it becomes clear that rape can happen to anyone. Stereotypes about how "real" rape victims look and act fall away, and myths about false reporting of rape relative to other crimes can be challenged.

Feminists have long argued that rape must be treated like any other crime. But in no other crime are accusers' identities hidden. Treating rape differently serves only to maintain its mischaracterisation as a "different" kind of crime, loaded with cultural baggage.

Finally, there is a profound moral issue here. Though children's identities should, of course, be shielded, women are not children. If one makes a serious criminal accusation, one must be treated as a moral adult. The importance of this is particularly clear in the Assange case, where public opinion matters far more than usual. Here, geopolitical state pressure, as well as the pressure of public attitudes about Assange, weigh unusually heavily. Can judicial decision-making be impartial when the accused is exposed to the glare of media scrutiny and attack by the US government, while his accusers remain hidden?

It is no one's business whom a victim of sex crime has had sex with previously, or what she was wearing when attacked. Laws exist to protect women from such inquiries. But some questions of motive and context, for both parties, are legitimate in any serious allegation.

The Oscar Wilde trial of 1895 is worth remembering. Wilde, like Assange, was held in solitary confinement. Like Assange, he faced a legal proceeding for alleged sex crimes in which there was state pressure on the outcome: the alleged behind-the-scenes involvement of the then prime minister, Lord Rosebery, ensured the likelihood of a "guilty" verdict. The roar of public opprobrium, in the wake of reports from accusers shielded in some cases by anonymity, also sealed Wilde's fate. His sentence – two years' hard labour – was atypically severe.

No one is proud of the outcome of that trial today. The lesson for us? Top-level political pressure and virulent public opprobrium – inflamed and enabled by anonymous accusations – can grossly distort legal process.