After the Marion Barry case, maybe it's time for judges to sentence criminals by computer. Feed the data -- the crime, possible prior arrests, sentiments of the victims, testimonial letters from old college roommates or prison cellmates, the contrition, if any, of the criminal, the cost of imprisonment to the public -- and press a key. Onto the screen comes the sentence: computerized justice, the Code of Macintosh as fair as the Code of Hammurabi and untainted by the judge's politics, race, sex, age and feelings toward the defendant's lawyer.

If a computer, rather than U.S. District Judge Thomas Penfield Jackson, had sentenced Mayor Barry for his one count of cocaine possession, would the results have been different?

Of course. Different, but no less arbitrary. Judges and computers can both apply the law. Neither can do more than guess at justice. Both create the kind of legalistic society that Barry accurately defined after getting six months in prison: "I should have been shocked and stunned. I'm not. I'm calm about it. I understand there are different sets of standards for different people. That's the American injustice system."

Barry had facts on his side. Moments earlier, he stood before a judge who unabashedly announced that his sentencing rationale was based on who Barry was, not what crime he committed. Jackson was opinionating when claiming that Barry "failed as the good example he might have been to the citizens of Washington." Barry broke the federal Good Example Law? In fact, many District of Columbia citizens -- I'm one of them -- thought Barry had done well to stand up to the cheap entrapment tactics of a Justice Department hellbent to snare him, on camera or off.

In sentencing an alcoholic and drug addict to a six-month stretch for a first-offense misdemeanor, the judge was compensating for the prosecution's failure. Federal attorneys brought Barry into court on 14 charges and could persuade a jury to find him guilty of only one, a non-felony. The cranky Jackson groused that the "jurors will have to answer to themselves and to their fellow citizens" for their verdicts.

Jackson and others in the get-tough wing of the criminal justice system have some answering of their own to do. Why do blacks, who are 16 percent of the nation's cocaine users, account for 57 percent of cocaine-possession arrests? Why are law enforcement nets set out in the neighborhoods of poor black youths and not the suburban neighborhoods of white children? Black juveniles, according to the National Institute of Drug Abuse, are 38 percent of the arrests for cocaine or heroin dealing, white juveniles 9 percent.

That blacks are arrested disproportionately more often than whites backs up Marion Barry's claim about the "American injustice system." Two drug wars are being waged, one a frontline, big-talk-from-the-Drug-Czar escapade that's capturing and imprisoning mostly blacks, and the other a backline exercise that ranges from putting up Nancy Reagan say-no posters in suburban high school corridors to giving community-service sentences to well-connected white drug abusers. The typical drug bust, covered by mobile television crews, has cops breaking down the doors of a roachy rooming house to catch a few zonked minority addicts. Why aren't cops storming country clubs or $700,000 homes in Bel Air, Greenwich or Chevy Chase?

Clobbering Marion Barry, a high-publicity criminal, with a jail term provides a fleeting gratification for those who believe in Western Union justice: Send 'em a message. One problem with judges like Jackson is that the message they think they're sending isn't getting through. During the 1980s, overcrowded prisons and jails were packed still tighter with drug dealers and abusers, yet no corresponding lowering of drug crimes resulted.

Malcolm C. Young, director of the Sentencing Project, a Washington advocacy group, asks a sound question: "It's fine to debate the wisdom of a jail term for Marion Barry. What's unfortunate is the lack of any real debate about the thousands of young blacks and Hispanics who are sentenced to prison every day in the war on drugs. We should be asking ourselves if this is an effective response to the problems of drug abuse and drug-related crime."

Marion Barry's sentence means that America's per-capita rate of imprisonment -- already the highest in the world -- keeps rising, as do record crime rates. Societal revenge and retribution, which is what the punishment of prison represents, keeps failing. Community-based programs of restitution, rehabilitation or victim-offender reconciliation are working.

Why don't more judges make examples of them?