After living and working in London for more than a decade, I moved back to Pakistan just over a year ago – and soon realised that the Pakistan I knew had migrated elsewhere. Mainly to the front covers of the sombre current affairs magazines you find in posh dentists' waiting rooms. The world's media had reached a consensus that I had boarded a sinking ship. Time, Newsweek and the Economist have all written an obituary of Pakistan, some twice over. The more caring ones are still holding a wake.

A couple of years ago when we decided to return, Pakistan wasn't exactly the world's safest destination. It was fighting its demons of poverty, the Taliban and a military dictatorship that fostered them. But it very much belonged in this world: a new bank was going up on every street corner and a new generation of media, telecom and property professionals was working overtime to sell bits of the country to each other. It seems that between us negotiating with the removal men and stocking up on jars of Marmite, the various editorial boards across the western world decided that the end of the world was nigh and it would all begin in Pakistan. Channan, my 11-year-old born-and-bred-in- London son, was so miffed by this that when he saw some white people at Karachi airport, he whispered furiously: "What are they doing here? Don't they know it's not a tourist country. They are always saying it's a terrorist country."

Yet I want to suggest an old-fashioned British clarification: all the news about Pakistan's imminent demise is premature. It has its civil wars. It has doomsday visionaries who like to send poor kids to blow themselves up and kill other poor people. But if its peasants and workers shared the doomsday vision, they wouldn't be marching up and down the country demanding better wages and working conditions. We have had five-star hotels and mosques full of worshippers blown up. And we have had something even more sacred – a visiting cricket team – attacked. But over the past two years hundreds of thousands of citizens have also participated in the largest peaceful political movement in South Asia in recent history and brought down the most well-entrenched military dictator in the world. (The deposed General Musharraf, by the way, has just bought himself a house on Edgware Road in London. All dictators turn out to be property speculators. If you spot a man puffing on a sheesha pipe and lecturing some unsuspecting Arabs about enlightened moderation, avoid eye contact.)

Here in Karachi, when people sit down in the evening they do not discuss what we should do because a leading current affairs magazine has declared us dead. They moan about power cuts and rampant urban crime. They talk about the sex lives of their domestic help and the dumbing down of TV drama. During our year in Karachi we have had many power riots, three general strikes and continuous ethnic tension that has more than once turned bloody. But we have also had one hugely successful film festival, about 40 music concerts, more than 20 plays and hundreds of protests.

Unlike a lot of immigrants in London I never had a frozen, idyllic image of a motherland to cherish and yearn for. First, because my motherland was never idyllic, and, second, my day job in London involved covering Pakistan. But yes, places change and they change when Newsweek is looking somewhere else. For instance it seems that when I moved to Pakistan a significant part of the country decided to cover itself in black hijabs and burkas. They weren't shying away from me, they had just decided that dressing like those women in the Arab desert was cool. The purda-fication of Pakistani women had started years ago but as a visitor I always assumed it was nothing more than a bout of seasonal piety. I grew up in a village in Pakistan where the first burka in the 80s was seen as a sign of vulgarity. It was a conservative village but it was open enough that you could walk into anybody's house; surely someone who decided to cover their face either had a deviant mind or was camouflaging some new perversion imported from some big city? For days, my late mother went around doing the Punjabi version of "there goes the neighbourhood".

Walking along the Karachi seafront after returning from London, I worked myself into a self-righteous rage at these young women in black burkas hanging out at the beach when they should have been at school or in some mosque praying for our collective salvation. But then I looked closely and found out that many of them were on a date. Some were actually making out, in broad daylight, with men with beards. Covered from head to toe in a black robe, this is quite a spectacle – and provides just the right combination of challenge and opportunity. Walking on the beach with my wife the other day, we stared at a couple who were exploring the full possibilities of the burka, using their motorcycle to lean against. With the Arabian sea lapping at their feet.

At the other end of the fashion spectrum, nattily dressed fashionistas on TV have started mixing piety with plunging necklines. (We have two 24/7 fashion channels. Also three food channels and, at the last count, five religious channels.) They talk about their last shopping trip to Dubai by pouting "masha'Allah" (God willed it) and conclude their plans for next season's collection with "insha'Allah" (if God wills). Depending on what else is happening in the name of religion on that particular day on the news channels (23 and still counting), I find it either very cute or another precursor to the destruction of our civilisation as foretold by the leading magazines.

But despite this the real spirit of Karachi still lies with the people who can't rely on divine intervention, who go through the gruelling daily cycle of life to earn their daily bread with a heartbreaking dignity. Those who do not have the luxury to cover up or doll up (or doll up and then cover up), those who cannot afford to invoke the name of Allah in every conversation, those who do not have a TV or time to watch it and those who will never be on TV except as a backdrop to the latest bomb attack: those are the ones who go to work every morning regardless of what any local or foreign media might be predicting. People such as the brightly dressed transvestites who light up the shores of the Arabian Sea in the evening and turn the beach into a catwalk. They are so elegant and poised that even our nosey police don't mess with them. They have their reasons for dressing up. Begging has become very competitive; our transvestites have to compete with kids so young that sometimes they forget that they have been put on the streets to beg and not to play.

So how are we doing?

We fretted a lot about moving Channan from London to Karachi but my fears were of a parent who consumed too much news. He has taken to Pakistan like those colonial officers who went from grim British suburbs to hot and noisy Indian cities and became men who knew everything. And wanted to own everything. He remembers London only as an opportunity to buy more gadgets. Family members visiting us there used to chide us for not teaching him proper Urdu or Punjabi. Now not only does he read and write Urdu, sometimes I hear a new slang on the street and go home to ask him what it means. And he always knows; he taught me chappa is no longer a police raid; it's that very un-cool thing when you copy someone's style.

My wife, Nimra Bucha, says she has found tropical plants and her actor's voice. Her one-woman show The Dictator's Wife has been playing to packed houses in Lahore and Karachi. She has also found more old aunts than I can count . . .

As a family we have come to appreciate the fact that we live in a world where the day a bomb doesn't go off somewhere in the country is a pretty good day. And even the power cuts become bearable. In Karachi, people discuss electricity in the same way we used to discuss weather in London; boasting about the capacity of their generators as if they are showing off their holiday snaps. Initially I liked not having electricity for part of the day, a mandatory media fast. I even started reading War and Peace. Then electricity started disappearing six times a day and the May heat slapped us around. We dropped our eco-friendly posturing and bought a generator.

Karachi is still a combination of oddities and surprises. It is the only city in the world where Pakistani cricket legend-turned-politician Imran Khan is banned. In an election where voters were British celebrity magazine editors, Khan could easily have become mayor of somewhere. However, Hello! has limited influence over public opinion in Karachi. But in a bizarre twist, Khan is barred from Karachi by someone who actually lives in London: Altaf Hussain, Karachi's favourite son and its most powerful politican, has been living in exile for more than 15 years. Since he left, his party has won every single election but he prefers to live in Edgware. Like an absentee landlord he runs Karachi as his personal fiefdom. So in a way my life here is still governed by someone who lives in a London suburb.

A journalist colleague pointed out recently that we, the people of Karachi, would much rather live with secular chaos than the Taliban. And every recent election has proved this. Every few days we hear warnings that the Taliban are coming, but Karachi has seen off its share of militant mullahs in the past and doesn't seem bothered. In fact one of the local parties spearheading the protests against the Taliban, or Talibanisation as they like to call it in Karachi, is Sunni Tehrik. With their regulation beards and fiery rhetoric, outsiders wouldn't be able to tell them apart from the Taliban. Their leaders have titles such as Naked Sword and go around the city with Kalashnikov-carrying bodyguards. But they hate the Taliban as much as the next fashionista.

Even our local liquor shop (which is supposed to sell to non-Muslims only, but runs its business on secular lines) put up a poster recently: Beware of Talibanisation.

I am often asked by friends here and there whether I miss London. I am awright in Karachi, masha'Allah. But occasionally I do miss hanging out with friends in a certain pub on the Strand and saying things such as, "Yes please, another organic lager." I hope there will be an opportunity to visit soon, insha'Allah.

• Mohammed Hanif's novel A Case of Exploding Mangoes won the Commonwealth prize for best first novel and is on the shortlist for the James Tait Black Award.