Living in a city that had 82 shootings over the Fourth of July weekend, Chicagoans could be forgiven for envying the residents of Indianapolis.

Imagine living in a place where homicides have been reduced by more than half in the past two decades, where robberies are less common than they've been in nearly half a century — where car theft is at levels not seen since "The Dick Van Dyke Show" was still in production.

Actually, that's where Chicagoans do live. I was only pretending to talk about Indianapolis. Those developments have all occurred right here.

Right now, the city is getting national attention for outbreaks of bloodshed, which reinforce its reputation as the murder capital of America. In terms of total homicides, it may be. But that figure fails to account for population.

In the overall rate of violent crime, Chicago ranks 19th — slightly worse than Minneapolis and better than Kansas City, Indianapolis and Nashville. It has half as much violent crime, per capita, as Detroit or Oakland, Calif.

Even when it comes to homicide, Chicago is enjoying, relatively speaking, a golden age. In 1992, it had 943 murders — 2.6 per day. Last year, it had 415 — 1.1 per day. Two decades ago, such progress was the stuff of dreams.

In 2013, the murder rate (homicides per 100,000 residents) was the lowest it had been since Lyndon Johnson was in the White House. So far, the homicide total for 2014 is 206, a bit below last year's pace.

Taken as a whole, the city has not gotten more dangerous. It has gotten less dangerous — much less. Nor does it stand out among its peers. "Chicago's overall violent crime rate is not exceptional when compared to other large cities," writes Yale University sociologist Andrew Papachristos in a recent study.

None of this is any comfort to recent victims of crime or to the families of young people who are gunned down in the street. But it's crucial to understanding the nature and size of the problem. High levels of criminal violence are a terrible reality in some neighborhoods, but not in most.

Even in the most dangerous areas, things may be improving. Papachristos contends that "even in the highest-crime communities, crime is going down. … Nearly all communities in Chicago experienced a decline in murder and overall crime over the past several decades."

That point is not undisputed. Daniel Kay Hertz, a master's student at the University of Chicago's Harris School, calculates that several of the most crime-ridden neighborhoods have gotten worse, not better.

No one doubts that the bulk of the violence is concentrated in particular places. People in most of the city are pretty safe. In the remainder of the city, though, the level of violence is staggering.

What accounts for it? One is the strength and reach of street gangs. In 2012, the Chicago Crime Commission reported that Chicago has more gang members than any city in America. Some 80 percent of murders involve gang members, either as the killer or the killed.

Gangs are as much a symptom of the city's problems as a cause. Chicago has a lot of areas that are almost entirely black — the result of decades of deliberate policies of racial segregation — and largely poor. Jobs are scarce, vacant buildings abound, schools are often inferior, good role models are hard to come by — and crime is a brutal fact of daily life.

Ta-Nehisi Coates, in a recent article in the Atlantic, wrote: "Chicago's impoverished black neighborhoods — characterized by high unemployment and households headed by single parents — are not simply poor; they are 'ecologically distinct.' "

Kids trapped in these areas face innumerable hurdles to success, omnipresent dangers to life and limb, and constant pressures to become part of the criminal class. So the tangle of pathology, as it has been called, tends to be self-perpetuating.

No one has come up with a way to untangle it that is practically plausible and politically salable. More police would help. So would ending the drug war. Better schools hold some promise. Economic development is indispensable. Neglect will only make things worse.

Judged as a whole, Chicago is doing a lot of things right. Judged by the plight of its least fortunate, that's not nearly enough.