Jonathon Green, as per the title of his not-quite-memoir, has a very odd job indeed. He is the world's foremost slang lexicographer. He collects slang. He makes dictionaries of slang. He has spent 30 years doing more or less nothing but. "I can no longer remember when life and work were still easily distinguishable. When, to render it in as simple a way as possible, I didn't work or aim to work 24/7/365. When I didn't live in terror of the abyss of inactivity. Of 'relaxing', of the 'day off'. I find no joy in the list of popular gap-fillers – popular culture, hobbies, travel. It all, ultimately, bores."

The results of his labour are three slang dictionaries (62,00 pages, 110,000 headwords, 415,000 citations) – of which his Summa Theologica, 17 years in the making, is Green's Dictionary of Slang (2010). After its publication, he writes, "I wept". His subject is narrow in scope but deep in synonymy. "I have written the two words 'the penis' 1,351 times (from 'Aaron's rod' to 'zubrick'); 'the vagina' 1,180 ('abc' to 'zum-zum') and 'sexual intercourse', by which I mean the heterosexual variety, 1,740 ('action' to 'zot'). I allow for detail as it is necessary to be precise: sometimes it is a large penis, sometimes a small one, sometimes flaccid, sometimes erect. Sometimes a penis is just a penis."

Does this benign monomania make him happy? The impression you get reading Odd Job Man is slightly different: that, rather, it makes him less unhappy. It gives a solitary, bookish only child – sensitive to his outsiderdom as a Jew in the English public-school system – a means of retreating from the world, of controlling it, of engaging with its vulgar pleasures at a safe remove. He writes repeatedly of himself that he is a "voyeur", and of his "cowardice". To be a lexicographer, he writes, is to be a drudge (as per Dr Johnson) but also (since you define and prescribe) a "tinpot deity".

Green doesn't tell you all that much about his life ("some confessions" is right). After he got stuck into slang, the suggestion perhaps is, there's not that much to tell. He owns many books and lives between London and Paris. He has children. He can afford to do his job thanks to a large and unexpected legacy, and was dunned out of another one in a bruising encounter with the law. His hero is Lenny Bruce. He kicked around as an underground journalist in the 1960s (he edited Oz while Richard Neville was in the dock), wrote a porn book, tried heroin ("Yum-my!"), compiled a number of hack books of quotations and had a lightbulb moment reading Eric Partridge's Dictionary of Slang and Unconventional English. Partridge defined "nafka" right – it means "whore" – but didn't know it was Yiddish. It made Green think: I can do this. And he was off.

But what is it, exactly, that Green is doing? Slang is a pretty fugitive category. The word itself (first print appearance: 1756) is of unknown etymology and remains resistant to definition. Slang isn't a language (it doesn't have a grammar) but a set of vocabulary items, and it lives in a territory adjoining and overlapping but not coterminous with (among other things) colloquialism, dialect, euphemism, abbreviation, professional jargon and various forms of figurative speech. For his purposes, "slang" is anything Green says is slang.

There's no doubt we've had slang as long as we've had registers of language. But slang as we know it begins, in his account, with late-medieval thieves' cant – collected in the titillating pamphlets of "rogue literature" and "beggar books" then percolating into the general population. Slang, to Green, is "counter-language". It is distinctively of the city. It is the lexicon of outsiders and rebels, constantly on the move, patricidal and mocking, and yet plugged into the most basic human activities: fucking, fighting, shitting, stealing stuff and getting fucked up. Slang has no word for love. And it's very male (Green touches on this here and there but one longs for him to develop it): "in this most manmade of languages women are always objects, never subjects".

But that isn't Green's main concern. He's not a sociolinguist or, as he freely admits, a linguist of any sort. He is an amateur (in the best sense: he does it for love) – not an entomologist but a butterfly collector. Not quite even that, perhaps. Slang is basically oral, and Green doesn't do fieldwork. What he's looking for is written or literary evidence (and that would include everything from Chaucer to The A-Team, which yielded 155 citations). It is quixotic: the traces of slang in the written language are the shadows those butterflies cast on the wall. Hard to net!

Green is a good enough sport to be upfront about how heavily each glossary of slang over the years perforce leans on its predecessors. In Language! he even quotes a party-pooping don who puts doubt at the very root of the discipline: "there is little evidence that real vagrants spoke thieves' cant, a notion fostered by rogue literature". Green says that her theory – that thieves' cant was simply made up, like Dothraki or brown windsor soup – is "as unprovable as the contrary thesis that she is at pains to decry". The absence of evidence, in other words, is not evidence of absence. Still.

Green has a faintly chippy relationship with the OED, to which he is a consultant but also (in his smaller field) a rival. He publishes first, and then, "distrusting the abilities even of one whom they claim to respect, the legions of Little Clarendon Street have reresearched my efforts and displayed them online as if their own". One-upping their first citations is a point of pride. When he finds an instance of the word "fuckadoodle" somewhere predating the OED's, one imagines him doing a little air-punch in his lonely room.

But Green and the legions of Little Clarendon Street are in roughly the same game. He has some starchier things to say about Urban Dictionary, which looks likely to shoot his fox. It's not actually a dictionary, as he rightly points out: it's more like a sort of linguistic wiki with its guts on the floor. And yet – while it forsakes the lexicographer's authority (any fool can add an entry and authority is a matter of accruing thumbs-ups) – it has the advantage of contemporaneity and, however messily corralled, the potential evidence of a massive body of current slang users.

Language! is a very interesting survey of the history of slang and the history of its collectors, taking in everything from the early literature of criminality to the Broadway backchat of Walter Winchell and Damon Runyon, from Soho's Polari to the black slangs emerging from slavery in the American south. What it declines to address, perhaps tellingly, is internet "leetspeak".

One of the book's virtues is that, by taking a step back from the lexis, Green is able to tease out family resemblances in the metaphors that lead us from the act to the slang word: the way that sex is often cast as violence, and so on. Language! bursts with linguistic interest and fun historical nuggets. Did you know that Swift may have been the first to use "blue" to mean obscene? Or that Smollett (though elsewhere Green says Cleland) minted the phrase "birthday suit"?

A fair amount of content is repeated between the two books, but there's a noticeable difference in the prose. That might be down to the author finding it more difficult to write about himself than about his subject (again and again, Odd Job Man skitters away into Green's safe zone). But the books also have different publishers.

Language! is, for the most part, limpidly written. Reading Odd Job Man is like paddling through mud.The autobiographical sections zip between first and third person, present tense and past narration, and are prone to tedious periphrasis when they spell things out at all. "Motherfucker" is "the Oedipal polysyllable". Tom Wolfe shows up, but – unnamed – is identifiable only by his white suit. A "well-known figure" is glimpsed off his face on booze, and the clue that his son-in-law would eventually "rule our waves" leads you to identify him as Tony Booth; but why not say so?

Yet Odd Job Man is also the more unusual and the more moving of the two books. Here is somebody whose life's work is not complete, and can never be complete: Green is a man swimming against an ever stronger tide. But it's a life's work that has – with the publication of his dictionary – passed its climacteric. And thanks to the internet, like a vocational concordance-maker in the age of digital search, Green is living through his own obsolescence: "It appears that I have spent my life becoming good at the wrong thing."

Incoherent though his achievement may be, however, it is also magnificent: a cathedral of bin lids built on foundations of quicksand. What's to be done? What he undoubtedly will do, until he drops dead at his desk: keep buggering on.

• To order Language! 500 Years of the Vulgar Tongue (Atlantic, £25) by Jonathon Green for £18.99 with free UK p&p call Guardian book service on 0330 333 6846 or go to guardianbookshop.co.uk.