Two similar incidents, two different wars, two contrasting outcomes.

The first happens in Helmand province in the summer of 2009 when a Welsh Guards patrol comes under heavy Taliban fire. At the same time an Afghan farmer and his four sons suddenly arrive by car to begin ploughing the nearby field only to be caught in the crossfire. Without thinking but remembering his own children back home, Lance Sergeant Matt Turrall rushes out into no man's land, directs the terrified Afghans into a drainage ditch and saves their lives. For this act of selfless courage he was awarded the Military Cross.

The second incident happens last Friday near the West Bank town of Nablus. After a group of Israeli settlers opens fire on a group of stone-throwing, Palestinian and Israeli soldiers arrive on the scene and started firing live rounds and tear gas. In the shoot-out, a 22-year-old Palestinian youth called Tayyib Ouduh falls dead and three other Palestinians are injured. No-one receives any blame; it's just one of those things in the longrunning war between Israel and the Palestinians.

Granted the background circumstances are very different, but I think I know which army I would prefer to represent me. The Welsh Guards patrol was part of the Nato forces in Afghanistan attempting to douse a ferocious insurgency war conducted by Taliban fighters who proved to be a skilful and tenacious enemy. They were also operating many thousands of miles away from home but they knew that the eyes of the world were on them in the shape of embedded television crews.

But that was not the reason why Lance Sergeant Turrall acted or why senior commanders insisted that Afghan civilians had to be protected. According to a British brigade commander at the time, people like the farmer and his sons deserved to be wrapped in cotton wool because in this kind of insurgency war "the population is the prize".

In Gaza and across the Palestinian territories, the Israeli Defence Forces (IDF) are also fighting against determined opponents in the shape of Hamas, only in their case they are also defending their homeland. Israeli operations have two aims: to destroy the tunnels used for smuggling weapons from Egypt and to smash the sites from which missiles are fired into Israel. Because Hamas places these sites near mosques and hospitals, civilian casualties are inevitable; unless there is a ceasefire the numbers will soon top 1000. IDF commanders claim that they are using legitimate tactics and that they will only stop when Hamas stops firing its missiles into Israel. The matter is also complicated by Hamas's absolute refusal to recognise the state of Israel and by the Palestinians' visceral dislike of Israeli settlement programmes.

There is a world of difference between what was happening in Helmand five years ago and what is happening in Gaza today but in both cases some things remain the same: soldiers and civilians find themselves sharing the same battlefield. This is not an environment for fighting a war and it beggars belief that the IDF has allowed itself to be sucked into this kind of operation. Soldiers generally hate fighting in built-up areas because it's difficult and dangerous and increases the odds that civilians will be killed.

For sure, the IDF have had their successes, reportedly destroying missile sites and blowing up many of the tunnels but this kind of conflict will never be won by military means alone.

As the US and its allies discovered when they invaded Iraq in 2003, it was easy enough to oust Saddam Hussein but it proved to be very difficult to extricate their own armed forces when the war ended and the insurgency began. By the same token, as the IDF found in 2012 when it last invaded Gaza, it took little effort to break in but getting out without losing face was no easy matter.

Meanwhile, the fighting continues and the atrocities keep happening. I'm all in favour of a country doing its utmost to defend itself from outside attack, but I'm also absolutely against seeing women and children paying the price. It's time for the IDF to show some courageous restraint.