In a speech last week to a group of New York lawyers, a federal judge from Brooklyn assailed the criminal justice system in which he has worked for more than 40 years, saying that the country had to “jettison the madness of mass incarceration” and find an alternative to overly punitive sentencing to address the problem of crime.

The speech by Judge Raymond J. Dearie of the Federal District Court in Brooklyn, at an event sponsored by the New York Criminal Bar Association, may not have struck new ground in its critique of the justice system. But it did put him in the company of other federal judges in Brooklyn who in recent months have come forward with scathing appraisals of things such as mandatory sentencing guidelines and the disregard paid to the socioeconomic roots of crime.

Last month, for instance, Judge Frederic Block wrote an extraordinary ruling saying that courts should pay closer attention to how felony convictions affect peoples’ lives with “collateral consequences” such as ineligibility for public housing and the denial of government benefits. And in March, just before he moved into private practice, Judge John Gleeson used his final decision from the bench to reiterate his own preference for handing down sentences other than prison time to some nonviolent offenders.

All three judges were, in some sense, working in the mold of Jack B. Weinstein, one of the longest-sitting judges on the federal bench in Brooklyn, which is formally known as the Eastern District of New York. In 2011, at age 87, Judge Weinstein went on a walking tour of the Louis Armstrong Houses in the Bedford-Stuyvesant neighborhood before issuing a novelistic ruling in a gang case. The nearly 130-page decision discussed the housing project’s paltry median income, its crumbling infrastructure and the effects of segregation and discrimination on its residents.