Pakistan, with its greater ethnic and religious complexities, appears even more ripe for all-out conflict than Algeria. Nor did the Algerian authorities store up trouble for themselves by encouraging Islamic militancy in neighbouring countries, as adventurist Pakistani military officers and religious parties have done in Afghanistan, Tajikistan and Kashmir.
The regional instability this has helped to create has infected Pakistan not only with guns and drug-smuggling, but with what could turn into a Muslim insurgency to unseat the government, if carelessly handled. These problems are at their worst in Karachi, the commercial capital, where religious, ethnic and criminal violence has claimed more than 300 lives this year and is starting to have serious economic effects.
One crucial difference between Pakistan and Algeria is that fundamentalist Islamic parties have never won more than a fraction of the vote in Pakistan's considerably more frequent and legitimate elections, yet they still appear capable of putting governments on the defensive. As the only country created for Muslims, Pakistan appears to feel constant pressure to prove it is being ruled in an Islamic way.
The late unelected Zia ul Haq introduced Islamic law. Nawaz Sharif, elected in 1990, brought in the death penalty for blasphemy, but retained the right of civil courts to review the findings of religious ones. This ensures that the numerous sentences of hanging, stoning and amputation that earn Pakistan an intolerant reputation are rarely, if ever, carried out, but it is the kind of attempted fudge that encourages fundamentalists to push harder.
Ms Bhutto has promised to deal firmly with fundamentalists, but she is constrained by the fact that she is a woman, which in their view makes her unfit to hold power. To many Pakistanis she is a symbol of reaction: a daughter of the landowning "feudals" who have traditionally monopolised power and avoided paying tax. Urdu-speaking businessmen, officials and industrialists whose rise has been blocked by this class have turned to Islam for consolation.
If there is a warning to be taken from Algeria, it is that the revolt there has its roots in decades of corruption and indifference to the welfare of the people, conditions familiar in Pakistan. Cracking down on fundamentalists will simply strengthen them, unless something is done to cure the problems, such as endemic illiteracy, that give them their influence.