The death of Fidel Castro brings back many memories: a nationalist, who taunted and defied 10 US presidents; a serial human rights abuser, who pushed Cubans to take their chances with shark-infested waters rather than face life under communism; an economic incompetent, who cynically manipulated nationalist sentiments to deflect criticism of his repressive dictatorship; and a revolutionary, who threatened to contaminate the Western hemisphere with potent Marxist-Leninist ideas.

Moreover, as long as the US and the Soviet Union were locked in mortal conflict, Castro's Cuba represented a strategic threat to America. After all, it was an ally of, and a potential base for, a rival superpower, especially as it was situated only about 140 kilometres off Florida's coast. As a result, it was the location for the most serious crisis of the Cold War.

In October 1962, the Soviets had smuggled nuclear missiles into Cuba. President John F Kennedy wanted them out and kept US nuclear forces at their highest state of alert. For 13 days, until agreement on the removal of the missiles was reached, the world was on the brink of atomic holocaust.

If you think the Americans were right to compel the Soviets to dismantle missile sites, as Western conventional wisdom holds, then here's an uncomfortable thought: doesn't Russia also have a legitimate interest in protecting its sphere of influence?

If you think Putin has violated international law by annexing ethnic Russian parts of Ukraine, shouldn't you also condemn Kennedy's breach of international law? After all, Washington supported an invasion to topple Castro's regime and tried to assassinate the man himself on multiple occasions.

And yet many people who praise Kennedy's response to the Cuban crisis more than half a century ago rail against Putin's conduct in Ukraine today. The logic is clear: like all independent states, Ukraine has a right to self-determination and join the West.

But did Castro's Cuba have a right to self-determination and join the East in the early 1960s? Certainly the Americans did not think so, which helps explain why they imposed an economic embargo on the island nation for decades. You might say that the circumstances were different, because the US was fighting the "evil empire".

This has shades of the pot calling the kettle black. How would Washington feel if the Kremlin today had signed up Latin American states in a military pact and then tried to plant missiles there pointing north or help topple democratically elected, pro-American governments in the region?

As for Ukraine today, Russia won't tolerate a situation where it is a Western bulwark on its border. Moscow has made it clear that if Kiev continues to pursue this policy, then Russia will go to great lengths to destroy Ukraine as a functioning society.

This is a shame, but it's the way the world works, and always has. And no power has been more insistent than America in demanding that its interests be protected in its strategic orbit and that the rest of the world keep its hands off the region. Historians call it the Monroe Doctrine.

Put yourself in Putin's shoes and see the world from his perspective. In the post-Cold War era, NATO and the European Union have expanded onto the frontiers of the former Soviet Union. Washington has even sought to extend security guarantees to Georgia and Ukraine.

Meanwhile, not only did the West just brush off Moscow's complaints about the deployment of US missiles in Eastern Europe, it helped bring down the democratically elected pro-Russian regime in Kiev. Only after Brussels and Washington helped topple president Viktor Yanukovych​ in February 2014 did Putin take Crimea, where Russia's Black Sea fleet is based.

Just as the Americans saw the Castro-Soviet axis as a threat, so too have the Russians viewed growing NATO assertiveness – including US military advisers and the CIA in Kiev – as a threat. If Kennedy failed to be firm with Castro, he feared the Soviets would build upon that success in Latin America. Putin has similar calculations about Western encroachment in Russia's space

.What about Moscow's hacking and spying in the US? Never mind all the major nations of the world hack each other. Just as Russia spies on the US, so does Washington spy on Russia – and China, France, Japan and so on. Indeed, a few years ago Wikileaks showed the Obama administration hacked Angela Merkel's mobile.

If the Russians have been particularly successful at hacking and spying lately, is that reason for treating their behaviour as something really dastardly? Or is it a reason for condemning and punishing those who allowed them to get away with it?

Which brings us to Donald Trump's overtures to the Kremlin. For all his flaws, the President-elect recognises his goal is to work out a modus vivendi based on the sober reality of power politics.

That means restoring a dialogue with Moscow, working with Putin against Islamic jihadists and turning Ukraine into a neutral buffer state between Russia and the West. In making the case for a new realism, Trump would help the world avoid a Cuban Missile Crisis-level nuclear confrontation in Russia's near abroad.

Originally published in the Sydney Morning Herald.