So here’s an out-of-the-box suggestion: Let’s build more branch libraries.
 
That thought came to mind while talking with Eric Klinenberg, a sociologist at New York University, who wrote a book about the 1995 heat wave in Chicago, which killed hundreds. Mr. Klinenberg discovered that while many predominantly poor neighborhoods fared badly, others, also poor, didn’t.
 
The difference? Less ravaged neighborhoods were more densely populated, with vibrant commercial strips and social networks, community gardens, parks and well-tended sidewalks. They drew people out of overheated homes and into the streets, shops, gardens, parks, and into libraries, too: places where there were things to do and friends to meet.
 
“People needed cool places to go,” is how Mr. Klinenberg put it to me. He meant oases that weren’t only air-conditioned or breezy. He meant destinations that were also attractive and familiar. Official city-run “cooling stations” in centers for the elderly, police stations and hospitals tend to be the last places people want to hang out. So they don’t.
 
A couple of lessons: Places that serve us well every day serve us best when disaster strikes. Health and safety go hand in hand with lively urban spaces. Invest in one, and you aid the other. Also, disasters can be opportunities.
 
It was instructive, after Hurricane Sandy, to see where relief hubs sprang up. The Rockaway Beach Surf Club, a party space in one of the hardest-hit areas, sheltered a homegrown movement. The club’s young owners, anxious to be good neighbors, posted a note on Facebook: If you need anything, come; if you have anything, bring it.
 
Hundreds arrived, then thousands, some bringing generators, even solar panels. People came to charge phones, locate a plumber, find a lawyer and commiserate with neighbors. They left dark, flooded, scary, lonely homes for the fellowship of a bright, crowded place.
 
The club became the heartbeat for a struggling neighborhood. It had a big yard and open spaces, so it was adaptable and good for crowds. A similar island after the storm, in Brooklyn, the Red Hook Initiative, is a community youth center hard by public housing, whose thousands of residents lost heat, electricity and running water. Without a basement that could be flooded, the Initiative weathered Sandy unscathed.
 
It had a kitchen for hot meals and a big common room, so groups could congregate. There was art on the walls, which made the place cheery. For weeks, the Initiative became a beehive, with residents and relief workers providing crisis counseling, checking in on homebound older people, collecting and distributing supplies, money and employment advice about recovery-related jobs. Like the Surf Club, the building was open and adaptable, an already organic part of the community, with a staff flexible enough to let outsiders in and take over.
 
Mr. Klinenberg stopped by the Initiative the other morning. He was shepherding several dozen competing architects and engineers around Red Hook as research director for the innovative Rebuild by Design competition organized by Shaun Donovan, President Obama’s secretary of housing and urban development, who oversees the Hurricane Sandy Rebuilding Task Force.
 
“Can we design places like this?” Mr. Klinenberg asked the group at the youth center.
 
Serendipity played a big role after the storm. Elsewhere in Red Hook, an art gallery-real estate office, Real Estate Collective, became another hub, the art providing solace, or so neighbors said. The window racks normally for apartment listings morphed into an impromptu billboard for neighborhood announcements.
 
To some extent, churches, libraries, schools and malls already serve as emergency centers, albeit not all churches responded or were equipped to be of help after Sandy. And as the novelist Zadie Smith lamented last year in The New York Review of Books, apropos the closing of neighborhood libraries in London, libraries are “the only thing left on the high street that doesn’t want either your soul or your wallet.”
 
Even schools are not quite like branch libraries. The branches have become our de facto community centers, serving the widest range of citizens — indispensable in countless, especially poorer, more vulnerable neighborhoods. They are much threatened by budget cuts, but never more in demand by toddlers and teenagers, working parents, the elderly and the unemployed, new immigrants and traditional readers.
 
With disaster in mind, they could be designed in the future with electrical systems out of harm’s way and set up with backup generators and solar panels, even kitchens and wireless mesh networks. After September 2001, Americans built bollards, barriers and berms. We outfitted airports and office buildings with metal detectors and long lines, fortified command centers, installed street cameras and constrained access to many sidewalks and plazas.
 
“We were possibly preventing another attack but certainly making our lives less pleasant and efficient,” is how Mr. Klinenberg phrases it.
 
In this case, we can learn from the Rockaways and Red Hook. If serendipity can’t be planned, it can be planned for; still, we shouldn’t have to rely on it. Disasters aside, branch libraries are a safe and equitable bet on our social and economic health. Trustees at the always tin-cup-wielding New York Public Library are now pondering a $300 million renovation scheme for its 42nd Street landmark. (Bill de Blasio, the Democratic candidate for mayor, told me recently that if elected, he would take a second look at the Bloomberg administration’s promise of $150 million in taxpayer money toward that renovation.) Meanwhile, potential billions in federal dollars could be available to rebuild the region, post-Sandy.
 
Maybe some of those resources could go toward improving our lives every day in ways that will also serve us well after the next disaster strikes.