EIGHTY years ago Lu Xun, now enshrined as the father of modern Chinese literature, observed that when others needed help his countrymen seemed to be stricken by apathy. “In China,” he wrote, “especially in the cities, if someone collapses from sudden illness, or if someone is hit by a car, lots of people will gather around, some will even take delight, but very few will be willing to extend a helping hand.”

Today such concerns lie at the heart of an agitated national debate spurred by a number of tragedies over the past few years. In 2011 a toddler known as Yue Yue was knocked down by two different vehicles on a busy street in Foshan, a boom city in Guangdong province in southern China. The vehicles did not stop. Eighteen people walked by before a humble scrap-collector picked her up. She later died in hospital. The episode was caught on surveillance camera and published online. It led to a public outpouring, with millions posting their outrage on microblogs.

Similar incidents crop up every so often. Also in 2011, an 88-year-old man collapsed in Hubei province in central China. Passers-by left him on the street for 90 minutes before some relatives arrived; he, too, later died. And last year a five-year-old boy was run over by a bus in Zhejiang province in east-central China. Videos posted online show bystanders ignoring his mother’s pleas for help.

Such grisly incidents are in fact rare. It is in the nature of things that good deeds go less remarked—including, for instance, a tendency for some Chinese couples to take in babies abandoned on their doorstep and, bureaucracy permitting, bring them up. Yet the incidents have stirred up press coverage and an anguished debate about contemporary Chinese values. Commentators blame the perceived callousness on China’s growth-at-all-costs mentality which, they claim, has created a moral vacuum. The China Daily said the case of Yue Yue symbolised “our moral decline”.

Worse, some say, those who come to the aid of others lack legal protection from a grasping and increasingly litigious society. Good Samaritans have often been shaken down by the very people they tried to help. In 2007 a student called Peng Yu was ordered to pay more than 45,000 yuan ($7,300) when an elderly woman whom he had taken to hospital after a fall accused him of causing the accident. The judge sided with the woman, reasoning that Mr Peng would not have bothered to help her unless he was at fault. Mr Peng got nationwide sympathy—though fresh evidence last year seemed to contradict his version of events.

Cases of extortion, though also rare, are widely reported. Yunxiang Yan, an anthropologist at the University of California, wrote in an essay on the subject that they constitute “a heavy blow to social trust, compassion, and the principle of moral reciprocity”. The health ministry has done its bit to discourage good deeds. Last year it advised people in a booklet on aiding others: “Do not rush to help, but manage according to the situation.”

A culture of compensation—the expectation that financial settlements will be paid to families of accident victims—has fuelled the debate. This month two teenage boys who tried to rescue two girls from drowning were pressured to pay 50,000 yuan each to the girls’ families for failing to save them. Mr Yan calls it “the Samaritan’s dilemma”: pitting a good act against the potential risk of anything going wrong.

Responding to this conundrum, this month the southern city of Shenzhen, often China’s most progressive, announced that it will implement the country’s first “Good Samaritan” law. The law aims both to encourage public acts of kindness and, crucially, to protect do-gooders should things go awry. It stipulates that Good Samaritans will face no repercussions if their efforts to help others are unsuccessful. Those framed for causing an accident now have the codified right to sue their accuser and claim—what else?—compensation.

Tan Fang, a professor at South China Normal University who set up a body to provide legal and financial support to Good Samaritans, argues that the new law serves an urgent need. If extended nationwide, it would make society more civil.

As it happens, society is not about to collapse. Especially among the young, volunteerism and philanthropy are on the rise. After the devastating earthquake in Sichuan in 2008, which killed 69,000, some 100,000 volunteers travelled to help the survivors. Yet the Chinese still operate, more than the people of countries where trust is stronger, through networks of kin, hometown acquaintances and work colleagues. Outside such networks, people do not always see it as their responsibility to help strangers, however acute their need. China’s traumatic years under Mao Zedong only reinforced the instinct. The Communist Party destroyed people’s relations with many institutions, including, sometimes, their own families. Speaking or acting in public for the sake of others at a time of political persecution might have deadly consequences. This has added to what Charles Stafford, an anthropologist at the London School of Economics, calls an abiding “anxiety” about sticking your neck out for other people.

Huge rural-to-urban migration has strained social networks further. Migration reinforces a reluctance to engage with strangers. Over time, however, the members of China’s new urban classes may come to identify with each other—and indulge more in the kindness of strangers.