Judges have for years struggled to define what makes one rape worse than another. And for good reason – the very definition of rape suggests an irreducible degree of trauma, and the idea of ranking rapes by level of seriousness can come across as particularly abhorrent to victims.

That hasn't stopped the courts from trying. In a guideline case in 1986, still cited today, Lord Lane said that the usual starting point of a five-year sentence for rape would raise to eight years in some circumstances: where a rape is committed by two or more perpetrators acting together, where the perpetrator is in a position of responsibility towards the victim, or where the victim is abducted and held captive, for example. And Lane said a perpetrator "who has broken into or otherwise gained access to a place where the victim is living" should also fall into the eight-year category.

In a form of prosecution appeal where the solicitor or attorney general refer cases to the court of appeal arguing that the trial judge's sentence is too lenient, Judge has almost doubled the sentences of three men – Michael Anigbugu, Hyung-Woo Pyo and Mark McGee. The three men were all convicted of breaking into and raping women in their own homes.

"Sexual offences committed by a burglar should be approached as if they are among the most serious offences of their kind," Judge said.

This might chime with the instinct of many women. Pyo's offence, for example, represents many female students' worst nightmare. His 20-year-old victim was a fellow undergraduate at Loughborough University. He broke into her room in halls of residence at 5am, silencing her with a gloved hand and then duct tape as he gagged, bound and raped her.

There is no questioning the seriousness of this type of attack, or the fact that it warrants a serious sentence. There is a problem, however, when this type of attack by an intruder is compared and contrasted with other forms of rape, deemed "less serious" by the courts.

For example, in "M", another well-known rape case in 1995, then Lord Chief Justice Lord Taylor sentenced a man who raped his wife in the bed they still shared after their marriage had broken down, to just 18 months. "There is a distinction between a husband who is estranged from his wife and … returns to the house as an intruder … and a case where, as here the husband is still living in the same house and indeed, with consent occupying the same bed as his wife," Taylor said.

That case, at a time when the courts were still in the first years of getting to grips with the concept of rape within marriage, would not be decided the same way now. But in "Millberry", a more recent case still cited in the courts, then Lord Chief Justice Lord Rose made it clear that "stranger rape" was still regarded as usually more serious than rape within a relationship.

"When considering 'stranger rape', the victim's fear can be increased because her assailant is an unknown quantity," Rose said. "Is he a murderer as well as a rapist? In addition, there is the fact that when a rape is committed by a stranger in a public place, not only is the offence horrific to the victim it can also frighten other members of the public. This element is less likely to be a factor that is particularly important in a case of marital rape were the parties to the marriage are living together."

Now Judge has added his new doctrine, that rape in a "safe haven" is worse than rape in, say, a dark alley, because the sanctity of the home has been violated.

It is possible to follow the logic in all of these cases, but the best advice when it comes to dealing with rape sentences also comes from the court of appeal, and from Judge himself.

"It is unwise to seek to compartmentalise the levels of culpability that can arise in sexual offences. It is fundamental to the correct approach that the necessary flexibility to which reference is expressly made should be borne in mind."

The facts that gave rise to those remarks were particularly extreme. Two teenage girls were repeatedly gang-raped by young men who filmed their ordeal and, in one case, finished the attack by permanently deforming the victim with a dose of caustic soda.

But the point is that no two rapes are the same, and no "categories" of offence necessarily account for the brutality of the crime or its effect on the victim. These are the factors which judges essentially seek to reflect in the sentence they pass. But ranking the seriousness of rape according to where it took place – assuming that a rape in a strange place is better than rape in the home, and that rape in the home is better when it takes place in the marital bed – is reminiscent of the court's past, not its future.

Sign up for the Guardian Today

Our editors' picks for the day's top news and commentary delivered to your inbox each morning.