A common accusation
One very common criticism of the Old Testament is that its laws - especially its retributive justice laws, "an eye for an eye..." are harsh. This of course is not a criticism leveled by anyone who has spent one hour in a typical village in the world - it's made by ignorant western arm-chair academics.
Village life across the world
If, for example, a lad touches up one of their girls, they will send the boys around, give that lad a sound beating, and two good things will happen as a result. First, the lad who did the touching will learn it's not a good thing to do: that will help him in life and protect all the girls in the community. Second, the family will gain the status as a family not to be messed with. This is also vitally important, because if nothing is done about the 'touching up' this will be seen as a weakness, and next time the girl is alone, she could be raped.
You and I westerners may not like it, we may prefer bobbies on the beat, but village justice is common across large parts of the globe. The village elders know this is going on and allow it - it's just part of the rhyme and rhythm of daily life.
The dangers of village justice
The great danger of village justice, however, is Justice. It is very easy for two eyes to be taken for one lost, two teeth to be knocked in the place of one. Human anger is impure and often over the top. Enter Old Testament law....
The Kindness of the Old Testament Civil Laws
The purpose of the OT laws is to curb and limit 'village justice'. They impose a limit on the retributive justice that can take place. They prevent the natural desire for revenge to go over the top. They prohibit people going too far.
Seen from this perspective, these laws safeguard the community.
The charge that these laws are 'barbaric' can only be made by people who are wholly ignorant of the ways of the world. Far from being barbaric, these laws are actually very kind.