It is impossible to examine the case of eight-month-old Charlie Gard and not be moved by it, nor emotionally torn by the arguments surrounding his treatment. Even for those who believe that the right to life is an absolute moral imperative at all times and in all circumstances, his incurable and, by all accounts, painful and progressive illness must raise questions about the value and sustainability of life as well as its sanctity.

In what was a morally and legally fraught case, the judge at the High Court who has ruled that doctors at Great Ormond Street can withdraw Charlie’s life support has obviously weighed every aspect of the case with impeccable care. Mr Justice Francis said he made the decision with the "heaviest of hearts" but with "complete conviction" that it was the correct decision for the child.

While there may be further legal activity and public debate about baby Charlie, there was nothing wrong with the way the court went about its grim business. It proved that the courts are in fact the best forum to take such decisions, and make judgments that will affect many other parents and children, and are capable of doing so with compassion.

Charlie’s mother and father, Connie Yates and Chris Gard, were right to want to prolong their child’s life. They were right to raise more than £1m to fund a trip to the US for treatment, and they were right to fight their corner in the legal process. It was natural for them to do so; indeed, they could do no other. The letter that Connie wrote to the court was especially heartrending. If there was some remote hope, then what was wrong with pursuing it?

Nothing except, as the weight of medical evidence indicated, that the treatment could not in any case be a cure, and nor, in fact, would it be much of a palliative. Even the medics in America who were consulted about the possible procedure were clear about that point. The disabilities and the pain suffered by Charlie had to be weighed against this central fact. When people talk of a “miracle cure” they do not often mean it literally; for baby Charlie, however, that is indeed what it would have taken for his heath to stabilise, let alone improve.

Ethical dilemmas such as this find their way to the higher reaches of the courts surprisingly rarely, given the circumstances. Such legal cases, in other words, are still rarer than the medical cases they are based upon.