The Supreme Court’s two former prosecutors sit on opposite ends of the court’s long mahogany bench, and they take very different views of the criminal justice system.

Justices Samuel A. Alito Jr. and Sonia Sotomayor have emerged in their relatively short time on the bench as two of the court’s most outspoken members on criminal justice issues. Sometimes they speak in unison, but when they disagree they often represent the court’s ideological divide.

Alito, a former career lawyer at the Justice Department and New Jersey’s U.S. attorney from 1987 to 1990, is wary of petitions from the convicted complaining of defects and worried about lawyers exploiting loopholes to try to free the guilty. “Public safety” is his bottom line and a phrase often repeated in his writing.

Last week, he complained of the “heavy toll” that accompanies the exclusionary rule, the court’s rule that evidence may have to be suppressed when police have not followed proper procedure.

“It almost always requires courts to ignore reliable, trustworthy evidence bearing on guilt or innocence,” Alito wrote for the majority in Davis v. U.S. “And its bottom-line effect, in many cases, is to suppress the truth and set the criminal loose in the community without punishment.”

Sotomayor also wrote for the court last week, with a very different tone.

She underscored the need for another court creation, the Miranda rule, which requires police to tell those held in custody that they have the right to remain silent and to an attorney. The 5 to 4 decision in J.D.B. v. North Carolina said child suspects deserve special consideration.

“Even for an adult, the physical and psychological isolation of custodial interrogation can undermine the individual’s will to resist and . . . compel him to speak where he would not otherwise do so freely,” Sotomayor wrote.

“Indeed, the pressure of custodial interrogation is so immense that it can induce a frighteningly high percentage of people to confess to crimes they never committed.”

Sotomayor was an assistant district attorney in New York for five years, and as a former district federal judge she is the only one of the justices who has presided over a trial or sentenced someone to prison.

She has been critical of courts that cut short the appellate process for some of those challenging their convictions and has rapped her colleagues for not agreeing to accept petitions from death row inmates who allege that their attorneys did an inadequate job of representing them.

Her decision in the North Carolina case last week was her second swing at the Miranda rule. She wrote her first major dissent last term when the majority ruled that police may continue to question a suspect until he asserts his right to remain silent.

The decision “turns Miranda upside down,” Sotomayor wrote. “Criminal suspects must now unambiguously invoke their right to remain silent — which, counterintuitively, requires them to speak.”

Jeffrey Fisher, a Stanford University law professor who frequently argues criminal cases before the Supreme Court, said it is clear that Sotomayor and Alito are the two justices who have had the closest contact with the criminal justice system. But he speculates that those experiences have provided different perspectives.

Alito has always been a federal prosecutor, Fisher notes, “where resources run deep” and cases are more carefully constructed. He comes with the view that police work is done right and that defendants are often trying to simply “game” the system.

Sotomayor’s experience in the New York DA’s office was probably more chaotic — and closer to the kind of prosecutions the court reviews. “She has a little more of an inkling that sometimes the system malfunctions,” he said.

Each can employ a blunt and skeptical tone. At oral arguments to review a judicial decision that California had to reduce its prison population by tens of thousands of inmates, Sotomayor asked the attorney for the state: “When are you going to avoid the needless deaths that were reported in this record? When are you going to avoid or get around people sitting in their feces for days in a dazed state?”

Alito, on the other hand, warned of a crime wave if the prisoners were released. When the court sided with the inmates, he warned in his dissent that “the majority is gambling with the safety of the people of California.”

The two also were in a direct debate in the North Carolina case; Alito wrote the dissent. He warned that injecting age as a factor that police and judges must consider complicates the calculus of when a person is in custody for Miranda purposes.

Sotomayor dismissed his concerns.

“Officers and judges need no imaginative powers, knowledge of developmental psychology, training in cognitive science, or expertise in social and cultural anthropology to account for a child’s age,” she wrote. “They simply need the common sense to know that a 7-year-old is not a 13-year-old and neither is an adult.”