There's a puzzling difference between the funding we provide as a society for children and adults who need looking after.

Ask councils how much they pay for the care of a child in care, and the cost is likely to exceed £2500 a week or if it includes residential education, could be considerably more.

But the national contract rate for an elderly person is £520-£600 a week for residential care or a nursing home place, when councils buy from the private sector. Meanwhile if you are funding your own place, councils will generally charge you around £700 per week to stay in a residential home.

When I spoke to Ranald Mair, chief executive of the private care homes body Scottish Care, recently, he described this as "appalling ageism".

It is hard to argue with that interpretation. The training and qualifications required of chilren's residential workers have been transformed in recent decades, and the requirements for staff in older people's care homes have been left behind. Their terms and conditions are poorer too and pay is low.

Why the vast discrepancy? One issue is undoubtedly to do with sheer volumes. Only a few thousand young people are in residential care at any one time, but there are 34,000 older people in care in Scotland.

Some might argue that some of the young people are very troubled, and need intensive help. That's certainly true, and the ratios of staff to residents in some children's units can be high. But older people can need intensive help too. Some need considerable routine medical care, while caring for someone with dementia is - or should be - a specialised task. People with dementia can often have significant behavioural problems as well.

Consider a scenario where two grown-up children have become unable to cope with the care needs of a parent with dementia. Too much for two adults, when that person is admitted to a care home, they may be in a setting where there is only one member of staff per four or five residents: you can understand why care providers find it frustrating.

I wonder if the funding differnce partly arises from the old cliche that children are our future and an idea that troubled kids can be helped with intensive care to sort out their issues for the long term. But the implication of that is that older people matter less - which is surely in itself ageist.

Against this background, private care providers, like care providers in the voluntary sector are trying to make sense of the Public Bodies Joint Working Bill that is under consideration at Holyrood. Like charities, they are increasingly wondering why the bill, intended to promote integration in care services, seems only to set up a structure for councils and health bodies to work together. I am starting to lose count of the number of different interest groups that have contacted me because they feel they are being shut out of the integrated care agenda. The legislation is developing a real credibility gap.

A proper debate is needed about the underfunding of adult care and before the joint working issue is settled. If the money spent on adult care is only enough for warehouses for the elderly, that is all we will get.