“Fife always felt very cut off from the rest of Scotland when I was growing up,” muses Ian Rankin as he munches on a bridie.

“It was always its own kingdom.” The crime writer and I are sitting in an old-fashioned bakery in Cardenden, his home town. It’s the sort of place where ladies in white caps and overalls serve you instant coffee; the empire biscuits are fantastic. 


We are here to take a Proustian trip down memory lane, to visit the places that featured in Rankin’s childhood, to discuss the impact Cardenden - a former mining town a few miles west of Kirkcaldy - had on him and on John Rebus, the fictional cop that has made him one of the UK’s most successful authors. Inspector Rebus is also from Cardenden, of course, though he is a good 10 years older than his creator, so they wouldn’t have rubbed shoulders at secondary school in Cowdenbeath. They also took different paths after leaving school – Rebus into the army, then the police, Rankin to study literature at Edinburgh University.


Rebus this, Rebus that. We are talking about this fictional character as if he is living flesh and blood rather than a figment of Rankin’s rich imagination. But that’s the whole point: 20 books and almost 30 years on from his debut, there is still something tangible, authentic and, well, very real about John Rebus. It goes some way to explaining why the books have sold in excess of 20m copies in the UK alone, topped bestseller lists all over the world and been translated into 37 languages. 


“I’m not sure Rebus and I would get on,” says Rankin, 55. “We could talk about music for a wee while, we could talk about Edinburgh, past and present. 


“But he would see me as a wishy washy liberal who has never had to do a hard day’s graft in his life. I’m not sure he would understand me, and I’m not sure I would understand him. He’s my Mr Hyde.”


Jekyll and Hyde, Robert Louis Stevenson’s most abiding characters, figure regularly in Rankin’s conversation, which is perhaps not surprisingly for someone who lives a life of crime – even if only on the page. The Rebus books are full of binary opposites and forensic explorations of the evil underbelly of an Edinburgh - described by Rankin as “the ultimate Jekyll and Hyde city” - that always likes to put its best (wealthy, middle class) foot forward.
Rankin says the fact that he and his creation are both working class Fifers is important - they view Auld Reekie through outsiders’ eyes and can cut through the pretension.


“Write about what you know is one of the things young writers are always told,” he says in his clear Fife brogue. “It made sense if my guy didn’t grow up in Edinburgh, and I didn’t grow up in Edinburgh, so I thought it would be easier if he came from a wee place like Cardenden.


“The young men I grew up with, if they didn’t go to university or college there weren’t many job opportunities in the mid-70s. Some went to the Rosyth dockyard, some to the police and some to the army. It made sense to me that Rebus would have joined the army straight from school then shifted to the police.”


So what was a Cardenden childhood like? “It was quite a tribal and close-knit place,” says Rankin. “All the old cliches were true – no one locked their doors, your aunts, uncles and cousins were all around you. 


“What I’d forgotten was how close to the countryside we were. My pals and me would think nothing of going for long walks in the woods or climbing the Craigs, which sat just behind the town. On Saturdays if we wanted to see a kung-fu film we’d walk the six miles to Kirkcaldy to save the bus fare.”
I ask him how the place has changed. 


“The quality of the people, the sense of humour, the philosophy of life, none of that has changed,” he replies. “Physically, of course there have been some changes. You have to try not to become too nostalgic – it can colour your impressions. And no one in Fife would thank you for nostalgia – people are just getting on with their lives.”


Despite this warning, being in Cardenden is also something of a step back in time for me too. I grew up nine miles away in the new town of Glenrothes and as a teenager had friends from the town. But I haven’t been in Cardenden for 20-odd years. At one point I recognise a bit of greenery where I walked hand in hand with a boy whose name escapes me. The now dilapidated miner’s social club we take a wander into once played host to an indie disco where I danced with abandon to The Smiths in 1991. Can that really be almost a quarter of a century ago?


Rankin, married to Miranda with two sons in their twenties, has travelled by train from his home in Edinburgh to Cardenden, which sits amid the large western expanse of Fife, the former industrial heartland that is a world away from the tourist magnets of St Andrews and the East Neuk. 


With a population of around 5,500, it has the look and feel of many once-thriving industrial communities that are still struggling to recover from the Thatcher years. There are boarded up shops and dilapidated buildings; but there is also some new housing and a few signs of regeneration. The area showed strong support for independence during the referendum campaign, though Fife as whole voted No by 55% to 45%. Rankin won’t be drawn on how he voted but says Rebus, a “conservative with a small c”, would have voted No. Siobhan Clarke, the detective’s long-suffering partner in the force, would have gone for Yes, he adds.


On the way to visit the primary school he attended as a boy, we pass Ian Rankin Court, a cul-de-sac of neat, new-build bungalows with garages and mono-bloc driveways. Rankin smiles at the idea of a working class boy having a street named after him. On more than one occasion he is stopped by local folk who are friends from back in the day, or distant relatives. 


One youngster on a scooter asks if Rankin is the “poet guy” and confidently demands an autograph, much to the author’s amusement. “Did I go to school with your granny?” he laughs. He’s clearly at ease on these streets; he still knows and understands the people. He attended a school reunion recently – hastily gathered after a couple of his classmates “dropped dead”, he points out, sadly – and has recently returned from a stag do in Krakow, in Poland, with friends he made more than 40 years ago. 


He describes his time at Denend Primary as “happy, happy days”, and remembers going home every day for lunch, or to his auntie’s a couple of doors down if his mother wasn’t in. Cardenden was a place of hard edges and good, decent people. His childhood home, a 1960s council house in a cul-de-sac, was content and ordinary. “Everybody I knew lived in a council house; I don’t think I realised some people lived in ‘bought’ houses till I was at high school”. 


His mother worked in a chicken factory, his father in a grocery shop, and he had two much older half-sisters. His mother died when he was 19 and at university, his father when Rankin was 29. 


We pass the shut-down corner shop where he used to buy copies of boys’ own comics such as Hotspur, Victor and later the music magazine Sounds, and move on to the library, housed in the same handsome miner’s welfare building where the young Rankin did much of his reading. He loved the Ladybird books as an infant, then moved on to wartime adventure stories and the novel versions of films such as Jaws, The Godfather and A Clockwork Orange, that he wasn’t old enough to see. “I loved anything popular and taboo,” he smiles, recalling sitting in a corner of the library for hours.


Did he always harbour thoughts of becoming a writer? Was writing even on the radar for angry young men – Rankin was in a punk band - in small town 1970s Scotland? The fact that he won second prize in nationwide Scots language poetry competition at the age of 17 suggests it was for this one.


“I tried to write comics but was no good at drawing, and I wrote lyrics for bands that didn’t exist,” he chuckles. “I was a bit of a chameleon. Up the road was the rough corner where we all hung out and glowered at anybody who came past in a car. I would hang out with the tough kids and try to look like I fitted in, but whenever they said they were meeting the Lochgelly kids for a fight, I’d say I had to get home for my tea. 


“Then I go up to my bedroom and write about it. I’d try and make sense of the world through writing.”


He says it wasn’t until he was in his twenties that he realised writing could be a career, and he spent more than a decade working at jobs including a grape-picker, taxman and hi-fi journalist before Rebus took off.


“There weren’t many books in our house,” he says. “I had no sense that you could make a living out of writing. When I went to uni I joined the poetry society and there were other young people who wanted to be writers. We’d pay poets to come and talk to us. That’s when writing became a real, viable thing rather than a pipe dream as it had been when I lived in Cardenden. 


“But I’m not first writer to come from Cardenden – Joe Corrie, a miner, was writing plays in the 1920s. So there were self-starters, people from my background who gritted their teeth and got on with it.”


Interestingly, fellow bestselling crime author Val McDermid was growing up around the same time in Kirkcaldy, while poet and writer John Burnside and the late novelist Ian Banks were spending their formative years in Dunfermline and North Queensferry respectively. That’s a pretty impressive of group; perhaps there was something in the empire biscuits.


Rankin and McDermid - who Rankin laughingly admits meeting for the first time in Seattle at a writers' event rather than on home turf - chose to focus on crime. I ask him why he thinks this is.


“I suppose crime can tell you a lot about society and the human condition,” he ventures. “It can tell us about the sort of people we are and what can happen to individuals and societies. That’s what has always intrigued me. All crime books boil down to same thing: why do we keep doing bad things to each other? 


“A lot of it still comes down to the seven deadly sins – things like greed, lust and envy. It also comes down to capitalism. And then there’s corporate crime. Crime fiction allows you to explore society from the top to the bottom and look at the interaction between these two, and where the different layers meet. How top bankers can in some way be related to the people at the very bottom of the food chain.” 


We drive the six miles from Cardenden to Kirkcaldy, which is where Rankin came for entertainment during his youth. He talks of heady punk nights at the Station Hotel and X-rated films at the cinema. We go down to the esplanade, where on a clear day you can see Edinburgh. Today is such a day and Rankin peers out across the Forth to the capital. I can imagine Rebus doing the same.
Despite having retired in the last book, Rebus is back this week, in the 20th book in the series, Even Dogs in the Wild, which is also the name of a song by Dundee post-punk legends The Associates. 


Rankin wrote much of the book – which features a wonderful opening scene set in the woods outside Cardenden with The Associates playing - at his holiday home in Cromarty, on the Black Isle, where there is “no mobile phone signal and no TV. I write all day and go to the pubs at night – perfect”. The book “almost wrote itself”, he says. 


We find Rebus struggling to cope with retirement, meaning he jumps at the chance to come back as a consultant detective when both Clarke and his old nemesis, criminal “Big Ger” Cafferty, need his help.


There’s more to it than this, of course. It’s a book about mortality and family ties, fathers and sons, the changing of the guard within families and wider society. Like the other Rebus books, it relies on tight, often humorous dialogue and intricate plotting. As with all Rankin’s writing, it rings true. 


“In this book you start to sense that the world has changed beyond Rebus’ ken,” says Rankin. “He’s been brought in because he has contacts at street level – but when he tries to tap into them, they’re not there any more. The pubs have gone. The world has changed out of his understanding.”


As I take my leave, Rankin is still looking out over the Forth from the Kingdom of Fife towards the Jekyll and Hyde city that made his fortune – and his creation famous. Not bad for two outsiders from Cardenden. 


Even Dogs in the Wild, by Ian Rankin, is published on 5 November by Orion, priced £19.99 in hardback and £10.99 eBook.