The sweeping criminal justice bill that Gov. Charlie Baker signed earlier this month received widespread, but not universal, praise as a welcome turn away from the tough-on-crime policies of the 1980s and ‘90s.

One notable dissenting voice was that of Setti Warren, the former Newton mayor who is now one of three Democrats vying to challenge Baker in the November election. Warren said there was lots that he liked in the bill, which pulled back sanctions in all sorts of areas, including eliminating or ratcheting back several mandatory minimum drugs sentences. But he denounced the inclusion in the bill of new mandatory minimum sentences related to the synthetic opioids Fentanyl and Carfentanil and said he would have vetoed the legislation because of them.

Sen. Will Brownsberger, the lead Senate author of the bill, called Warren’s position “uninformed,” and said it prompted him to endorse Jay Gonzalez, one of Warren’s rivals in the Democratic primary for governor.

Warren and Brownsberger sat down together to discuss their differences in this week’s Codcast. The crux of the debate came down to finding the right balance between sticking with one’s principles and the need for compromise to move things forward.

“This is not something we started with in our bill,” Brownsberger said, referring to the Senate version of criminal justice legislation, which did not include the new mandatory minimums. He said he would not have included them in the final bill, either, had it been entirely up to him. But Brownsberger said there was support for the new sanctions in both the House and Senate, and he called the final bill a “compromise product” that has way more provisions that will reduce incarceration than elements that could increase it.

Warren, who maintains the new sanctions were included because Baker wanted them, said it makes no sense to enact new drug mandatory sentences at a time when we are finally coming to terms with their devastating effects. “I know that mandatory minimums are discriminatory, I know that they don’t reduce crime, and I know that they don’t reduce addiction,” he said. Warren pointed to data showing that 73 percent of those incarcerated in the state under mandatory minimum sentences are black and Latino.

Mandatory minimums “hurt communities of color,” said Warren, and as an African-American man whose father was arrested in civil rights sit-ins in the 1960s, he said his opposition to them is “a matter of principle.”

Many members of the Legislature have “exactly the same principles,” said Brownsberger, yet they voted for the bill, including every black and Latino lawmaker.

Things got a little testy at one point when, despite Warren saying clearly that he opposed all mandatory minimum sentences, Brownsberger proceeded to pepper him with questions about a list of crimes for which there are currently mandatories, asking him in each case if he opposes mandatory sentences. Warren said he did. (His campaign also pointed out that Brownsberger’s candidate for governor, Jay Gonzalez, has said he favors elimination of mandatory minimum sentences for all crimes except first-degree murder.)

Brownsberger said the act of compromise means being willing to compromise one’s principles. Warren didn’t disagree, and said, for example, that he wished the final bill had included a provision raising the age for juvenile court jurisdiction to include 18-year-olds; the candidate said he would have signed the measure without it — as long it didn’t include new mandatory sentences. (Warren never really answered why, if he were governor, he wouldn’t have returned the bill with amendments striking the mandatories rather than vetoing the whole bill entirely.)

They found common ground on one point.

Warren said it’s important to “draw a line in the sand” and that for him that means opposing the introduction of any new mandatory minimum sentences. “We respectfully disagree,” he said to Brownsberger.

“We do,” replied the Belmont lawmaker.