Alex Salmond has more important things on his mind just now obviously, but I wonder how often he thinks of the old days when he was First Minister and the SNP was in the ascendancy and he could joke that there were more pandas in Scotland than Tory MPs. It was a decent gag, somewhat spoiled by the 2017 election. But with pandas in Scotland about to be reduced to zero, maybe it won’t be too long before we’re making the old panda/Tory comparison once more.

But how do we actually feel about the pandas? Did you approve of them being taken from China to Edinburgh? Did you buy into the idea that their presence in Scotland would help the efforts to conserve and protect pandas in the wild? How do you feel about animals in captivity generally? And how do you feel about the pandas being sent back to China? Did you see them? I did, and I must say Tian Tian and Yang Guang were delightful, like big, puffed-up, slow-motion toddlers. But always, always, the nagging question: is this right?

It’s a good time to be asking these sort of questions because there’s only four days left now to see the pandas at Edinburgh Zoo. But the answers aren’t easy. I spoke to Alison Maclean, the keeper in charge of the bears, and, like I do whenever I speak to zoo keepers, I was impressed with her commitment and love (love’s the right word I’m sure). Ms Maclean talked about the conservation angle and told me a lot of the work done with the Edinburgh pandas helps research in the wild. “Everything is done for the whole species,” she said, “and that’s where our contribution is as well.”

I also remember speaking to two remarkable men from Uganda, Geresomu Muhumuza and Monday Gideon, who work in the Budongo Forest protecting the wild chimpanzees who live there. Edinburgh Zoo funds their field station and the men told me about the work they were doing to reduce the impact of snares. Delightfully, they also told me what observing chimps up close is really like and about particular individuals, like Zig and Squibs. Chimpanzees are 98.5% similar to humans, said Geresomu, so what they do, we do.

However, even Geresomu and Monday admitted there are compromises to be made in the link between zoos and conservation because the conditions in which Edinburgh’s chimps live are not, and cannot, be the same as the conditions in which chimps live in the wild. The question then is to what extent, if at all, keeping some animals in captivity is worth it because of the positive effect on conservation and the protection of engendered species in the wild. Let me have a stab at answering it.

Read more: Mark Smith: Inside the blockade of the women’s rights film. We can’t go on like this

The first thing to say is that, ideally, zoos would not exist at all. I was at Jersey Zoo recently and its founder Gerald Durrell once said that he would tell people his greatest ambition was to shut his zoo down. What he meant was he dreamed of a day when there were no endangered species and there would be no need to keep them in captivity. And from the start, conservation was at the heart of Jersey Zoo so he really meant what he said.

We also know we’re a very long way indeed from the ideal day Durrell dreamed about and so we need to ask how we can best help endangered species and the research and breeding in zoos plays a part in that. When I was at Jersey, I watched a beautiful, ponderous ploughshare tortoise make his way round his enclosure. Would I prefer him to be in the wild? Yes. But the ploughshare is only found in a tiny area of Madagascar and hundreds of them have been released into the wild from the captive population kept by Jersey Zoo.

There are a lot of other examples of animals that have been saved from extinction by zoos, my favourite being Pere David’s deer, which was once widespread in China but was hunted to oblivion. Fortunately, there was a small group in captivity in the UK and it was from that population that the animal was reintroduced into the wild. Durrell himself looked after some of the young ones at Whipsnade Zoo and called them animal refugees, dependent for their existence on a handful of human beings.

The Herald:

Of course, the work zoos do for endangered species creates a tension between conservation and commercialism: the zoos need to raise money for their work and that means selling tickets. And selling tickets to the public isn’t necessarily the model you’d design to raise money for conservation. Jersey Zoo itself is aware of this tension and there have been ructions recently among some of the staff about whether the zoo is focusing too much on species that aren’t endangered but pull in the punters, such as aardvarks or even Guernsey goats.

This is not an easy tension to resolve and I think a lot of us, like Durrell, would dream of a day when zoos weren’t necessary. Whenever I go to one – and I felt it when I saw Tian Tian and Yang Guang and the chimps at Edinburgh – I’m aware of two things: awe and delight at the natural world and also a kind of gnawing guilt that the animals aren’t free. But then I try a bit of amateur philosophy and remind myself that even in the wild, animals are restricted to certain territories by predators and the need for food and water and that humans as well are confined by all sorts of things – job, money, status, whatever. It’s the old question isn’t it and it applies to all species: what is freedom?

It means surely that the farewell we offer to Tian Tian and Yang Guang is bittersweet. I wish pandas weren’t at risk in the wild. I wish conservation work wasn’t necessary to help them. I wish there were better ways to protect endangered species than keeping some in captivity and putting them on show to snotty kids munching crisps on a Bank Holiday Monday. But we’ve got to be realistic about what the human species has done to thousands of other species and do what we can to put it right, and that involves compromises and solutions which aren’t entirely perfect.

Read more: My Doctor Who toy brought me comfort and joy as a child and still does as an adult

And so I will continue to support zoos, as long as they put conservation at the heart of what they do. David Field, the boss of Edinburgh Zoo, said the other day that Tian Tian and Yang Guang had had an incredible impact on the natural world by inspiring people to care about nature, in a world in which more than a million species are at risk of extinction and I think, and hope, he’s right.

He also said that the outlook for giant pandas in the wild has improved and it gives us hope for the future. It really does. But it’s still grim out there isn’t it? Gerald Durrell said he hoped that one day zoos would no longer be necessary. But I suspect he knew, deep down, that such a day was never, ever likely to dawn.