Barry always knew he’d end up in trouble with the law. It never really felt like a choice. It was more like some kind of inescapable rite of passage.

His childhood was as disastrous as they come, he says. His dad, who did time in prison, died in his mid-30s of cancer. But he might just as easily have died of drugs or alcohol. His mother, left to rear five children in a flat off Hardwicke Street in the inner city, wasn’t able to cope.

“We ran wild as kids. My mam worked two jobs. Looking back now, I see she wasn’t really fit to be a mother . . . We didn’t get on, so I just ran away from home.” The first time he was arrested he had just stolen a burger and chips from McDonald’s in Phibsborough. He thinks he was about 11 years old. Soon, he was stealing to order. Older kids, even adults, were telling him what to nick from department stores.

“I was tiny. I’d be going around in my school uniform. I’d get away with anything . . . I felt important. You don’t really have a choice at that age, do you? What had I got to lose?”

He kept coming to the attention of gardaí. Soon social workers applied to put him in care. There were mixed results: he remembers a nice foster family but admits he was too wild. Life was soon a blur of broken care placements, emergency hostels or grim bed and breakfasts.

All the while he was clocking up charges and bench warrants. He had a few stints of detention in St Michael’s – an assessment and remand centre in Finglas for troubled youngsters – and Oberstown detention school.

As soon as he was out he was back at it again. He was stealing cars and jewellery, and inevitably getting caught. He was committing crime with the same muddled inadequacy that he and his friends handled their lives.

“You don’t really have a choice at that age,” says Barry, now in his mid-30s. “It seems like it’s the only way.”

The Children's Court in Dublin sees cases like this on a daily basis. Despite the glass roof and bright walls of the courtroom, there is little to lighten the overwhelming sense of gloom that hangs over many of the cases.

In 2005 research by the Irish Association for the Study of Delinquency found what many had suspected: the vast majority of children coming before Dublin’s Children’s Court were from the poorest parts of the city.

But poverty was just part of the picture. Most were from broken homes or had a parent with a criminal record. The majority had left school before the age of 16. Many had very poor literacy and, quite possibly, learning difficulties. The children for the most part had brushed up against the justice system years previously. In fact, 20 of the 50 children that featured in the study were known to gardaí before the age of 12.

Fr Peter McVerry, the social justice campaigner, calls them “disaster childhoods”: chaotic homes with drug-addicted parents, rife with violence and neglect, where the children might stay out on the street to avoid hassle at home.

“I know that if I was born into their family, I would be no different to them, and possibly even a lot worse. Children should not have to cope with such childhood experiences,” he says. “And some children can’t cope. They take drugs to cope. They have robbed, burgled, assaulted, frightened, intimidated innocent people – but before this they were beaten up by fathers, sexually assaulted or neglected.”

He says the need for support for children and parents is obvious – though authorities have never prioritised this kind of response. “Parents of these children have a huge sense of being trapped. While other parents can pay for therapy, counselling and family intervention, these parents are trapped in a community with very few skills and resources.”

It was the day of his 16th birthday. Barry got a present he wasn’t expecting: a stay in St Patrick’s Institution for Young Offenders.

“I was shitting it that day,” he says of his day in the Children’s Court. “I had coppers winding me up, saying ‘you’re going to get raped’. St Pat’s – a section of Mountjoy Prison reserved for younger offenders – was a different story to anything before. This was serious. It was scary.”

In the months beforehand, his crimes were getting increasingly aggressive. He did lots of things he wasn’t proud of, such as mugging people with screwdrivers and unprovoked assaults. It eventually caught up with him.

On the first night in St Pat’s he shared a cell with two others. He knew them from school – they had been in or around the same class as him. Soon, he was learning more about crime than he ever imagined.

“It was like going from secondary school into university. I was learning how to cut up drugs, how to wash dye out of money from security vans, doing favours for fellas in some of the gangs.”

In all, he served two stints in St Pat’s. By the time he got out he was moving deeper into the fringes of gangland activity, helping with ram-raids and shifting drugs. “The way it was, the gang members were your heroes,” he says. “They were the people you looked up to. That was the way it worked.”

The longer a child stays in the justice system, the worse the outcome seems to be. So what other solutions are there? There aren’t any easy answers. But in the absence of being able to eradicate long-term issues such as poverty and inequality, most campaigners agree that early intervention is crucial to give the most disadvantaged young people a better chance in life.

Providing support to parents who can’t cope is crucial. So too is early high-quality childhood education. Simple initiatives such as breakfast clubs – to ensure children get to school in the first place – play a key role as well, say many social justice campaigners.

Tackling poverty is one thing, says Fr Tony O’Riordan, who works with young people at risk in Limerick city, but tackling the poverty of opportunity is equally important. “Children in the most disadvantaged areas are acutely aware that they don’t have the same pathways of opportunity that others have. They are disadvantaged from the beginning and we need to address that,” he said.

By the time a child comes to the attention of gardaí or the courts it can often be too late. Solicitors who deal with cases before the Children’s Courts on a daily basis say there is a lack of meaningful options available to judges to help redirect a young person from a path of anti-social behaviour or criminality.

“By the time we see a a child before the courts, they are 13 or 14. By that stage, by and large, their antisocial behaviour is so entrenched that it’s very, very difficult to try to get them to change,” says one solicitor.

“It’s accepted behaviour among the peer group. It’s the norm in their local environment. This is ultimately an issue of child poverty.”

Social supports aimed at helping parents and younger people are being cut back as public spending is reined in. But there is plenty of evidence to suggest this is a false economy. Take parenting programmes, which are found to improve child behaviour and provide long-term benefits for families.

Researchers at NUI Maynooth recently estimated that while it costs about €2,200 on average to deliver a programme per family, the health, social and economic benefits are estimated to be worth €315,000 per family.

Those who benefited from high-quality intervention were found to have higher earnings, were more likely to stay in employment, had higher academic achievement and committed significantly fewer crimes later in life.

This alone isn’t the answer. Tackling intergenerational poverty and crime isn’t easy. But programmes such as this point to the fact that outcomes for the most marginalised of children can be improved with early intervention and sustained focus.

Barry now has children of his own. His priorities have changed dramatically. And though he tries to stay out of trouble, he can’t leave those rough-and-tumble years behind.

He says he sleeps with a weapon beside his bed and has been on methadone for years. His name is tattooed across his fist. It’s a reminder of a more turbulent time of his life, when reputation and status meant everything. “I’ve done so many bad things, I’ve done a lot of damage to people. I made a reputation for myself but I’m not proud of that,” he says.

He is 33 years old, though he looks older. His eyes are sunken and his face is lined. He still drinks a lot, he says, and relies on methadone and tablets to get him through the day. Though it’s hard to see it sometimes, he imagines a brighter future ahead for him and his kids.

“My head is still f***ed up. I’m on tablets,” he says. “But I’ve two daughters. They’re my priority now.”