The criminal-justice system needs to recognize that carrying a gun illegally imposes a risk of serious harm to society. In this sense it is a lot like drunk driving, which also used to be subject to “no harm, no foul” sentencing. Drunk driving declined only after tough laws and law enforcement made it a grave crime.

Illegal gun carrying should be treated the same way. The risky behavior itself should be punished; waiting until something terrible happens isn’t good enough.

Some worry that increasing the penalties for illegal gun carrying will add to prison overcrowding. Mass incarceration in America does merit concern. One answer is for states and federal authorities to review other crimes for which mandatory minimum sentences are too stringent.

But ensuring that the penalties for illegal gun carrying are swift and certain, even if they are relatively mild, could lead to less incarceration. It would deter people from taking guns in public and committing more serious violent crimes that force judges to put the offenders away for a long time. “Swift and Certain” is the slogan, in fact, of the National District Attorneys Association’s anti-gun-violence effort.