The bombings Monday at the Boston Marathon show little of the evil genius displayed on Sept. 11, 2001 — only diabolical fiendishness. But the bombings occurred at a place, near the finish line, and a time, four hours after the race began, when crowds would be dense.

Terrorism needs targets, and urban environments or crowded events are always going to be tempting, whether the weapons are crude pipe bombs, as in Boston and at the Summer Olympics in Atlanta in 1996, or the four jetliners on Sept. 11.

After the World Trade Center’s destruction, many wondered whether terrorism would permanently discourage urban density. Yet New York proved resilient and so will Boston. After acres of central office space were destroyed in 2001, the question was whether fear would push the people away from urban towers, streets and subways. While terrorists have continued to kill in cities such as London and Madrid, urban areas in the U.S. have been relatively free from such explosions for a decade.

This new attack reminds us of the need for precautions against those risks. Cities, like airplanes, can be made far safer, though protection comes at a cost of both money and liberty.

The view that terrorism inevitably makes cities less attractive understands only that they are natural targets. Yet the compact nature of a place also means it can be defensible and even a harbor. Urban density has also raised risks of ordinary crime, contagious disease and devastating fire, but we have successfully made cities healthier and safer.

A primary early motivation for clustering in cities was that they could be shielded by walls providing protection against outside marauders. Constantinople was an urban giant for the millennium before it became Istanbul because its walls and watery defenses usually made it an island of safety in a hostile world.

Today, it is possible to imagine sea walls protecting lower Manhattan from some future Hurricane Sandy, while it is inconceivable that the entire New Jersey coastline could be similarly defended.

Tall buildings are targets, yet they are more defensible than sprawling suburban office parks because of their limited entry points. More than 30 years ago, I had to go through heavy security screening to visit my mother at work in the Mobil Building in midtown Manhattan. Threats were made against the oil company, but never did significant damage. And it proved possible to seal the building off against outsiders.

London’s Ring of Steel is a modern urban wall — built after a wave of bombings by the Irish Republican Army — that forced cars in the inner city to slow down and be photographed. Police officers, housed in concrete structures, manned the wall and created a sense of permanent vigilance.

Walls have provided only limited defense against modern terrorism, yet urban scale provides other advantages that can also bring safety. Like New York, Boston has a police department that has helped reduce the murder rate. The department’s competence was on view on Boylston Street as police acted swiftly to rescue the victims and clear the streets.

The Boston Police Department does well at the soft stuff, too, building the community connections that create the trust that leads to tips and testimony and that can defuse tension. Last year, for example, the police befriended the Occupy Boston movement, helping to engineer a peaceful end to the lengthy sleep-in. These skills would never be built into the police force of a small, rarely troubled suburb.

The compact nature of cities also makes surveillance easier. This is where we face the debate between safety and privacy. London turned to a web of surveillance cameras after the IRA bombings. Since 2007, New York has had its Lower Manhattan Security Initiative that relies on “surveillance feeds from more than 3,000 cameras and 100 license plate readers.” Many of these cameras are privately operated but connected to the city’s system.

There were plenty of surveillance cameras in operation during the Boston Marathon, so clearly they don’t deter an attack. Yet the video footage may still prove useful in tracking down the perpetrators. On normal days, Boston doesn’t have a London-style surveillance system, and I hope that one doesn’t prove necessary. Still, it is always an option if we are ready to forgo the anonymity of city streets for greater safety.

After 9/11, it seemed possible that terrorists could attack cities by targeting transportation as well as skyscrapers. If urban transit systems became particularly dangerous, this could push people away from cities. If flying becomes excessively onerous, it makes it more attractive for businesses and industries to cluster in one metro area and avoid the security lines.

In research that Jesse Shapiro and I did in the months after 9/11, we looked at the history of terrorism, warfare and urban growth, in particular in cities such as Jerusalem, Tel Aviv and London. We saw little evidence that the threat of terrorism had significantly altered urban fortunes. With 10 years of hindsight, the 9/11 attack symbolized New York’s resilience more than its vulnerability.

Cities exist to connect humanity and to enable us to work collaboratively. Those urban connections only strengthen when we are faced with an outside attack. Terrorists may have hoped to frighten Boston. Instead, they will find that its spirit of collaborative self-protection, which once triumphed on Concord’s Old North Bridge, is still strong.

Edward Glaeser, an economics professor at Harvard University, is a Bloomberg View columnist. He is the author of “Triumph of the City.” The opinions expressed here are his own. (eglaeser@harvard.edu.)

In a time of both misinformation and too much information, quality journalism is more crucial than ever.
By subscribing, you can help us get the story right.