A good and faithful judge,' wrote Horace in the Odes, 'prefers what is just to what is expedient'. Court cases are sometimes controversial and can attract wide interest. The public and the media will often express their views on the merits of a case, perhaps in strident tones. This is inevitable in a free society, but safeguards exist to protect the integrity of the related legal proceedings.

If a case is before the court for decision, the 'sub judice rule' applies, which means that while the matter is being judicially considered, it should not be prejudged by debate outside the court. The function of the court must not be usurped by others. The rule applies where proceedings are imminent or ongoing, and applies not just to the parties themselves and their lawyers, but also to the public, the media and politicians.

In a criminal case which may be tried by a jury, it is important for public debate on the guilt or innocence of the suspect to be avoided, as this might influence the potential jurors. However, in the case of serious crime, pretrial publicity is inevitable, and the judge will need to ensure the defendant has a fair trial.

The judge will direct the jurors to disregard what they may have heard about the case previously, and to decide the issues on the basis of the evidence placed before them. Court of Final Appeal judge Roberto Ribeiro has said that 'the jury may sensibly be credited with the ability to overcome any pretrial prejudice because of the nature and atmosphere of the trial process itself'.

In rare circumstances, the judge may even adjourn the case until the publicity has died down, or transfer the case for trial by a judge sitting alone, on the basis that he or she will not be affected by the publicity. It is almost unheard of for a judge to stop the case altogether because the publicity has deprived the defendant of his right to a fair trial, although defendants do sometimes seek this remedy. As England's former chief justice Lord Taylor once said, if it were otherwise, this 'would mean that if allegations of murder are sufficiently horrendous so as inevitably to shock the nation, the accused cannot be tried, and that would be absurd'.

If, however, a case, whether civil or criminal in nature, is tried by a judge sitting alone, the concerns over the effect of pretrial publicity on the case effectively fall away. Upon appointment, the judge will have taken an oath to 'safeguard the law and administer justice without fear or favour, self-interest or deceit'. This means that he or she is taken to be capable of deciding the case on the basis of the evidence and the law, and of not responding to extraneous influences in the decision-making process.

The notion that the judge who has donned his or her wig and gown and entered the courtroom will decide the case in a strictly legal, unemotional way, is fundamental to our legal system, and has long been acknowledged by the courts themselves. The Privy Council's Lord Griffiths, for example, once said that the ability of a judge sitting alone to exclude anything prejudicial from his reasoning is explicable as 'his whole background and training have fitted him to do so'.

In this context, the recent warning to the public, from Secretary for Justice Wong Yan-lung, to show respect to the judge handling the judicial review when expressing views on the domestic helpers' right of abode case is startling, not because it was given, but for the reasons that were provided.

The secretary's claim that the airing of views 'might prejudice or affect the court's adjudication of the case' sends out a wrong message to the community, and highlights muddled thinking. It flies in the face of accepted legal wisdom, which acknowledges the capacity of a judge sitting alone to try a case fairly on the basis of the evidence and the law, uninfluenced by extrajudicial comment.

Of course, the judge must not be pressurised, but there is absolutely no reason to think that he might be. No matter what views may have been expressed by the public, and many different opinions have been aired, the judge can be relied upon to decide the case fairly and independently, in accordance with his oath of office. The assumption that he will do so is fundamental to our legal arrangements, and must be respected by all.

That the judge will, in due course, arrive at a judgment by a process of strict legal reasoning is, surely, one of the strengths of our judicial system, and should be trumpeted by those in authority.

Grenville Cross SC, an honorary professor of law at the University of Hong Kong, is the vice-chairman of the senate of the International Association of Prosecutors