For all readers of Trainspotting who do not come from lowland Scotland (and perhaps for some of them too), the main difficulty of the novel is also one of its peculiar pleasures: making out what people are saying. For Welsh's characters do not only speak in dialect, they narrate in it too. "The sweat was lashing oafay Sick Boy; he wis trembling," the book begins. The narrator of this chapter (and of almost half the book's 44 chapters) is Mark Renton, and he tells us his thoughts as he speaks. "Ah wanted the radge tae jist fuck off ootay ma visage, tae go oan his ain, n jist leave us." As with Burns's poetry, if it looks obscure all you have to do is speak the words aloud.

Some accents are thicker than others. "These foreign cunts've goat trouble wi the Queen's fuckin English, ken." This comment about the incomprehension of a pair of Canadian tourists in the face of his uncompromising Edinburgh dialect is made by the atrocious "Franco" Begbie. Begbie is a man with a healthy disdain for drug abuse and an unhealthy contempt for the nuances of the English language. His language is as violent as many of his actions: "Ah wis the cunt wi the fuckin pool cue in ma hand, n the plukey cunt could huv the fat end ay it in his pus if he wanted, like." "Deek the fat radge."

"Radge" is a frequent noun, and there are other choice additions to the vocabulary of any southern reader: "buftie" (gay man), "swedge" (a fight), "poppy" (money), "flunkies" (condoms). (I infer these meanings from the contexts in which the words are used, as any reader may do.) But for the most part, the characters are speaking or narrating not in an unfamiliar vocabulary but simply with strong regional accents. Sentences that mystify the newcomer are easy-peasy for the practised reader: "Thuv goat tae dae it aw fir thumsells." Only the "it" is standard English, but it is a phonetic representation of a perfectly ordinary clause ("they've got to do it all for themselves").

Such dialect may be thoroughly non-standard in its spelling, but it is transparent compared with, say, the speech of the servant Joseph in the first edition of Emily Brontë's Wuthering Heights. "'Tmaister's dahn i' fowld. Goa rahnd by th'end u' laith, if you went tuh spake tull him." This is his first sentence in the book, and makes Welsh's Edinburgh smack addicts seem lucid in comparison. (After Emily Brontë's death, her sister Charlotte rewrote the dialect to make it easier for those she called "Southerns".)

Welsh is not unique, and has himself acknowledged the influence of James Kelman, whose novels such as The Busconductor Hines and How Late It Was, How Late are narrated in Glaswegian dialect. (Though Kelman himself dislikes the term "dialect" as elitist.) Ironically, it was that genteel Scottish novelist Sir Walter Scott who first introduced carefully rendered dialect to the British novel. Welsh himself switches between dialect and standard English (for the chapters of third-person narration).

Confiding in the reader, Renton makes a joke of his ability to withdraw from dialect. "A stunning coup de maître," he thinks to himself, when he hoodwinks social security investigators. Describing his friends' resentful anxiety in the face of police activity, he comments: "On the issue of drugs, we wir classical liberals, vehemently opposed tae state intervention in any form." Later, on trial for shop-lifting, he saves himself from prison by switching into "proper" English to protest that he was only stealing books in order to read them.

Renton has, after all, been a history student at Aberdeen University (though he has left after a year of spending all his grant money on drugs and prostitutes). He switches into supercilious RP as occasion demands. "I can only suggest that you pursue your complaint with a member of the British Rail staff," he tells the two student-types in whose reserved seats he and Begbie are sitting. "My friend and I took these seats in good faith." The John Lennon-lookalikes dispatched, he reverts to type. "The lager's loupin. Seems tae huv gone dead flat, ken. Tastes like fuckin pish."

Sick Boy is similarly "bi-dialectal" (as the academics would say). He is scornful of student thespians visiting the Edinburgh festival, "zit-encrusted squeaky-voiced wankers playing oot a miserable pretension tae the arts". But he knows the names of the Brecht plays that they put on. He mocks Renton for the self-contradiction of calling him a "sexist cunt". He is hot on language. "That scoobies the cunt. Eh sais something biscuit-ersed in reply."

Speaking in dialect is self-conscious. Spud knows that he cannot switch codes like Renton. "Ah'll huv tae stoap sayin' 'ken' sae much. These dudes might think ah'm a sortay pleb." He is comically doomed by his speech. When Renton tells the magistrates about his hunger for books, Spud responds to the accusation that he has stolen to fund his drug habit with the candour of dialect. "That's spot on man ... eh ... ye goat it ... ah mean ... nae hassle likesay." Prison awaits.

· John Mullan is professor of English at University College London. Join him and Irvine Welsh for a discussion of Trainspotting on Thursday June 12 at the Newsroom, 60 Farringdon Road, London EC1. Doors open at 6.30pm and entry costs £8 (includes a glass of wine). To book a ticket email book.club@theguardian.com or phone 020 7886 9281