The demolition of Cornton Vale Women’s Prison is overdue and very welcome. In the annals of Scotland’s lost buildings, it will not be mourned.

It has long been apparent that many of the women held in this outdated jail should not be there.

There are a number of reasons for this view. Only a minority of its inmates could be viewed as a danger to society. With around 360 women prisoners currently in custody in Scotland, the Scottish Government believes a new 80-cell unit to be built on the site of the existing women’s prison will be sufficient to house those who genuinely pose a significant risk to communities.

Secondly, the damage done to others by imprisoning women can be grave and far-reaching. Just because a woman offender is a mother should not mean some kind of pass from facing justice, but we need to recognise that children are often the innocent victims when women are jailed and the result can often be a significant cost to society.

Thirdly, Cornton Vale was exactly the wrong place for many of the women sent there - for many of whom offending was a symptom of addiction to drink or drugs, or severe mental health problems, or both.

The new custody units being proposed by Justice Secretary Michael Matheson are therefore a major step forward - offering options for serving a sentence closer to where women live, with more scope for addressing the underlying causes of their offending, and helping reset lives which are often chaotic. This is not limp liberalism, but an effective way – arguably the only way – to prevent recidivism.

The wider justice strategy announced by Mr Matheson yesterday is also a positive one.

The Scottish Government’s claims it wishes to shift more of the £2.5bn a year we spend on criminal justice, directing it increasingly towards prevention rather than enforcement - for men and women alike. Mr Matheson points to major falls in youth offending, founded on early intervention and prioritising support over punishment, as evidence for this approach.

It is vital society is protected from criminality and those who transgress are punished. Communities need to be kept safe and there must be disincentives for those would harm us.

But most reasonable people accept that prevention is better than cure, and when a cure is needed then addressing the issues underlying offending is more likely to work than penalties alone.

Such a shift is unlikely to be smooth, however. The length of time that has passed since former first minister Henry McLeish pledged to cut the women’s prison population in the 1990s is a lesson, as is the Scottish Government’s struggle to fulfil its intention to integrate health and social care.

The justice system is like an ocean liner which has been sailing a false course. It is already partially turned but it will take time and real commitment to fully change direction. Still, the path ministers are steering is the right one.