I am surprised not to have read complaints about the language of The Curious Incident of the Dog in the Night-Time, a book originally marketed as children's fiction and still sold in an edition for "younger readers". For it is unsparing in its use of four-letter words.

The very first piece of dialogue in the novel contains an obscenity. Mrs Shears, a neighbour of the narrator, Christopher, comes out of her house in pyjamas and housecoat to find him hugging her dead dog, Wellington. "She was shouting, 'What in fuck's name have you done to my dog?"' Christopher is chaste in his language, but dutifully records the swearing of other characters. "'Let go of the dog,' she shouted. 'Let go of the fucking dog for Christ's sake.'"

Christopher cannot imagine censoring the dialogue that he transcribes. Facts are all he knows, and recording is his ambition as a narrator. Unable to comprehend others' emotions, he can at least be exact. "I put the dog down on the lawn and moved back 2 metres." Without comment or selectiveness, he tells us just what adults say. Much of the book's comedy lies in the contrast between the factual blankness of his narration and the exasperation implicit in the four-letter words he hears.

Often he himself is the unknowing source of this exasperation. Utterly truthful, indefatigably logical, Christopher drives even the calmest adults to the edges of their linguistic resources. "Jesus", "God", "bloody hell", they exclaim (though Christopher, not registering their feelings, puts in no exclamation marks). Novelists usually use swearing as a sign of authenticity: being true to the way people speak means not keeping bad language out. Comically, adults in Haddon's novel try not to swear but are driven to do so by Christopher's innocent, pedantic pursuit of truth. Sometimes they try hard, like his mother's lover, Mr Shears, when Christopher turns up at their London flat.

"And I said, 'I'm going to live with you because Father killed Wellington with a garden fork and I'm frightened of him.'

And Mr Shears said, 'Jumping Jack Christ.'

And Mother said, 'Roger, please.'"

Having banned Christopher from interrogating their neighbours (he wants to be a detective and find Wellington's killer), his father discovers that he has been questioning the old lady who lives opposite.

"Then he said, 'Holy fucking Jesus, Christopher. How stupid are you?'

This is what Siobhan says is called a rhetorical question. It has a question mark at the end, but you are not meant to answer it."

Christopher notes some logical quirks of language, but records swearing without comment or comprehension. He cannot hear his devoted, linguistically dishevelled father being driven to distraction.

"He stood in the middle of the kitchen and closed his eyes.

Then he opened his eyes and he said, 'I need a fucking drink.' And he got himself a can of beer."

Have obscenities ever been used more cleverly in a novel? Swearing tells us of the real world of emotions out there, within Christopher's hearing but beyond his ken. It is a world not of higher rationality, but of bungling and distraction. Expletives tell us (but not the narrator) of all the comic moments of adult hopelessness. Wonderfully descending from authority to panic is the policeman who finds Christopher, running away from home, on board the London train standing in Swindon station. Christopher hates being touched and starts screaming as the policeman tries to usher him off.

"And then the train jiggled and it began to move.

And then the policeman said, 'Shitting fuck.'"

When Christopher's father enters his bedroom and finds that his son has discovered the letters from his mother that he has been hiding, only the most uninventive swearing can express his sense of the terrible mess he has made of things.

"And he said, 'What the fuck are you...? That's my cupboard, Christopher. Those are... Oh shit... Shit, shit, shit, shit, shit.' Then he said nothing for a while."

This is the kind of speech that Christopher, who has Asperger's syndrome, would never use, for it is the direct expression of feeling. Yet it also stands for the linguistic incompetence of all those normal adults, inadequate in all their different ways.

· John Mullan is senior lecturer in English at University College London

· Have your say about The Curious Incident of the Dog in the Night-Time on the Guardian talkboards or write to The Review, The Guardian, 119 Farringdon Road, London EC1R 3ER