HE'S sexist, racist, violent, foul-mouthed, wears white loafers - and millions love him. Life on Mars, the time-travelling cop show, has been the best programme to appear on BBC1 since Doctor Who stepped out of the Tardis again, and its greatest asset is the character of detective chief inspector Gene Hunt.

For anyone not familiar with it, Life on Mars is about a young detective from the present day, Sam Tyler, who has an accident and wakes up in the seventies. Sam is the very model of a modern police officer. He's kind, sensitive, the sort who'd rescue a puppy from a burning building. Gene, his boss, is the guy who would have started the fire in the first place to teach the rotten dog a lesson about piddling on the carpet. He's a bad man.

Yet no matter how many offences against modern sensibilities Gene perpetrates each week, this Bernard Manning of light entertainment can do no wrong. He has already helped the programme win an international Emmy and it has been picked up by an American network.

The character is so powerful, indeed, he seems to have taken over the actor who plays him. Philip Glenister doesn't have any of Gene's more loathsome traits, but he shares his fluency in the language known to sub-editors as "Asterisk". Asked his opinion of current television, Glenister said he was "p****d off" about awards for soap operas, the people who made them didn't give a "****" about creativity, and while he had a soft spot for Coronation Street, EastEnders was "up its own ****".

Readers don't normally like to see their favourites effing and blinding like this. It spoils the magic and shows a lack of respect. The Queen probably has the Radio Times in her loo, for heaven's sake. In this case, however, Glenister's rant simply added to Gene's allure. As far as political correctness goes, DCI Hunt is a nightmare; and that's what makes him a dream to watch.

Hunt comes from a long and distinguished line of bad guys who do viewers a power of good by breaking the rules. Imagine Dirty Harry Callahan referring ne'er do wells to social services instead of making them guess whether he fired six shots or five from his .44 Magnum. Try to picture Inspector Jack Regan of the Sweeney knocking politely on some lout's bedroom door instead of booting it in and uttering those immortal lines: "Get your trousers on - you're nicked." How silly would Samuel L Jackson have looked charming those snakes off the plane?

Compared with these guys, Gene is a big girl's blouse. He still performs sterling work, mind. He's a back-street hero, a working-class warrior who never lets the buggers - to heck with asterisks! - grind him down. In an age where men are meant to be meek and mild, watch their fags and alcohol intake and mind their language, he's as refreshing as an ice-cold lager on a sweltering day. And we know that deep down he's an OK bloke, really. We know because the writers are careful to give him a chance to redeem himself at the end of every episode with an act of kindness or an apology. He might be a caveman, but he's not entirely beyond hope.

Unlike some bad boys we could mention. Sitting at number one in the git parade is Jack Bauer of 24. In the current series, the counterterrorism agent played by Kiefer Sutherland has breached more Geneva Conventions in one day than the Iranian leadership in one week. Among those to have felt his wrath as he bugs, burgles and tortures his way across Los Angeles is his own brother. It has been brutal, shocking, turn-away-from-the-screen stuff.

The character has gone so far over the line, in fact, that the dean of West Point military academy, worried about young soldiers picking up bad ideas, visited the 24 set for a meeting with producers. (Given the actions of some US forces in recent times you might think that horse bolted long ago.) Bauer illustrates the trouble with bad-boy characters in drama. There's a line between being a bit iffy and outright fascism, and they have a habit of crossing it. Bauer is still on the right side - just. As for Gene, this is meant to be the last series of Life on Mars. The makers have promised to bow out with a "natural and explosive climax". I can see it now. Gene in the interrogation room with a suspect, sipping camomile tea and discussing The Female Eunuch. Sam, meanwhile, manages to get back to the present day just in time to conduct the final interviews in the cash-for-honours inquiry. Will he rescue a puppyish prime minister from a burning administration?

There are internet rumours about Gene going it alone in his own series, but that won't do. He needs Sam to help him progress to the eighties and lead him through the dark valley where Duran Duran, yuppies and Thatcher lurk. Keep the act together BBC, or you're nicked.