Nothing is easier than to second-guess decisions made in wartime. Anyone who has bothered to read the history of wars knows that very few wars have been without disastrous surprises, often on both sides.
It is not that the people in charge are stupid. Too many things are unpredictable in war, despite politicians who demand timetables, as if running a war were like running a train.
We can now look at the Iraq war with hindsight, as no president or secretary of defense could when making decisions that had to be made. Still, it can be useful to determine with hindsight what went wrong, if only to avoid similar mistakes in the future and to see what needs to be changed in the present.
Despite all the politicians who were demanding more troops a year ago, and who have turned around and are now demanding that no more troops be sent to Iraq, the purely military aspects of the war have gone better than in most wars.
We have learned the hard way, notably in the Vietnam War, that military victories are not enough. American troops scored a big victory on the battlefield in 1968 that was presented in the American media as a big defeat - and that began the political unraveling of that war.
Many in the media seem to think that they did something noble to get us out of an "unwinnable" war. But the war was unwinnable only because they made it so politically. Even after American troops were withdrawn from Vietnam, South Vietnam was able to hold off the invaders from North Vietnam.
Only after Congress cut off financial support for South Vietnam, while the North Vietnamese continued to get support from the Communist bloc, did South Vietnam fall.
Since then, even the Communist conquerors have admitted that they did not win on the battlefield but in the American media and in the American political arena, surrounded by an atmosphere created by a defeatist media.
Most of today's media, led by The New York Times, have been even more blatantly one-sided in their reporting. Everyone I have heard from in person who has been in Iraq paints a far different picture from that of the gloom and doom of the media.
Make no mistake about it, we can still lose this war, but it will have to be lost politically. Most of the tragic chaos in Iraq today has its origins in politics.
American and other coalition troops in Iraq have had their hands tied with "rules of engagement" based on political, rather than military, considerations.
You cannot have law and order in any country where armed bands of competing militias can terrorize the population. Instead of confronting these militias at the outset with an ultimatum to disarm or be killed, we let the Iraqi government veto what our forces could do, leaving Shiite militias intact in Baghdad's Sadr City neighborhood and elsewhere.
Having pushed the "democracy" vision for Iraq, we could not simply disregard the country's elected government. But democracy arose in Western civilization centuries after law and order had been established. We tried to do it in the reverse order in Iraq. When push comes to shove, people will support tyranny rather than suffer lethal chaos that makes normal, everyday life impossible for themselves and their children.
The success or failure of the troop surge in Iraq may depend far more on whether those troops will again be hamstrung by politically restrictive rules of engagement than on how many troops there are.
The government of Prime Minister Nouri al-Maliki is politically dependent on one of the very Baghdad militias that need to be disarmed. We can pressure and warn Mr. al-Maliki all we want, but his real choice will be whether he can survive - either politically or personally - without militia support.
Our choice may become whether we are prepared to sacrifice more American lives in order to prop up the al-Maliki government or whether we are prepared to sacrifice the al-Maliki government in order to restore law and order in Iraq.
That government is a product of our "nation-building" under the banner of a democracy for which Iraq may not have been ready.
Thomas Sowell is a senior fellow at the Hoover Institution at Stanford University. His column appears Thursdays in The Sun. His e-mail is email@example.com.