In Vietnam, President Lyndon B. Johnson and Secretary of Defense Robert McNamara knew in 1964 that the war in Vietnam could not be won, at least the way we think about winning wars. There is historical evidence that President John F. Kennedy would have started removing troops after he won re-election in 1964.

The problem is that neither did because they didn’t want the label of being soft on communism and the first president to lose a war. Johnson kept doubling down and finally Richard Nixon and Henry Kissinger concocted a way to bring the sad tragedy of Vietnam to an end at the cost of 58,220 U.S. military lives.

Now we are in the 17th year of the war on terror in Iraq and Afghanistan, and none of our wartime presidents has clearly defined when our troops will be brought home. Like in Vietnam, we seem to just keep on keeping on.

Although we have not lost anywhere near 58,000 troops, the nearly 14,000 troops and contractors who have been killed are too many. In addition to the deaths, there have been more than 52,000 wounded and 900,000 disability claims filed with the Department of Veteran Affairs.

In addition to casualties, the Congressional Research Service has put the cost of these two wars at $1.6 trillion in 2014. More comprehensive cost analyses — Brown University and CSIS for example — estimate that the total cost is between $4 trillion and $6 trillion. Whatever number is closest to being right, it is large and represents about 20 percent or more of our national debt. Not only does that add significantly to our fiscal problems but like Vietnam the burden of paying that cost has been shifted to future generations.

We went into Iraq to find weapons of mass destruction and to replace Saddam Hussein and into Afghanistan to retaliate for the 9-11 attacks. There were no weapons of mass destruction found and we mishandled the aftermath of deposing Hussein. Osama bin Laden was killed six years ago, and al-Qaeda and the Taliban either destroyed or seriously damaged. So, why do we still have 5,000 troops in Iraq and 15,000 in Afghanistan? What is the end game for the complete withdrawal of troops?

The official narrative is that our forces remain to help bring political stability to both countries. The real reason is that our most recent presidents are victims of the Vietnam syndrome. President Barack Obama came close to withdrawing troops from Afghanistan but got wobbly because he would be accused of losing the war on terror or appeasing terrorism.

In the case of both Iraq and Afghanistan, history demonstrates that goal of politically stability is an illusion. The Sunni and Shia populations have been in a state of conflict since about A.D. 700, and Afghanistan is a loose collection of warring tribes. The notion that we know how to promote a stable political environment is a triumph of hope over experience.

In her book “The March of Folly” that chronicled the pursuit of policy that was contrary to self-interest from Troy to Vietnam, Barbara Tuchman had this to say about Vietnam: “No one is the Executive Branch advocated withdrawal partly in fear of encouragement to Communism and damage to American prestige, partly in fear of domestic reprisals.”

And: “A last folly was the absence of reflective thought about nature of what we were doing, about effectiveness in relation to the object sought. … Absence of intelligent thinking in rulership is another of the universals, and raises the question whether in modern states there is something about political and bureaucratic life that subdues the functioning of intellect.”

Written 34 years ago, Tuchman prophetically described the situation that confronts us today.