Associated Press
Presidential candidate Barack Obama, right, walks beside U.S. military commander Gen. David Petraeus at Baghdad International on Monday.

Barack Obama's visit to Iraq seems to have given him a more realistic view of the war.

In that sense, the trip was important. While it clearly was an effort by Obama to shore himself politically against criticism that he is soft on foreign policy, it is vital that whoever occupies the White House next year have a clear understanding of the foreign threats facing the nation. Equally important, the presidential campaign this year should be informed by facts and realistic goals, not just slogans and artificial timelines.

The irony is that the war in Iraq may soon become a nonissue in the election. That's because the three main people in the debate over the war, Obama, John McCain and President Bush, seem to be coming together, rather than drifting apart. And that, in turn, is a direct result of Bush's successful troop surge, which has succeeded, to a large extent, in routing the enemies of a free government in Iraq.

President Bush has begun talking about a general timeline for withdrawal, although he has begun shoring up forces in Afghanistan. Both McCain and Obama favor putting more troops in Afghanistan. Obama's timeline for withdrawal from Iraq would accomplish that in 2009, while McCain is talking about 2013, but those are minor differences. Iraqi Prime Minister Nouri al-Maliki has said he prefers a quick withdrawal, but his comments have to be considered in light of his own desires to be re-elected. Most Iraqis want U.S. soldiers out, but they tend not to understand the ramifications of a quick total withdrawal.

During the Cold War, U.S. foreign policy remained remarkably consistent, regardless of whether a Republican or Democrat sat in the White House. That sort of consistency served the nation well. Although it led to a disastrous management of military affairs in Vietnam that spanned three administrations, political unity against communism in general led to the ultimate collapse of the Soviet Union.

While, in retrospect, the decision to invade Iraq was misguided, the Bush administration appears to be leading that campaign to a successful conclusion. That makes it easier for both parties to unite behind the general notion that terrorism must be defeated in Afghanistan and Pakistan.

Events certainly could change things before November, but for now it appears voters will be more concerned with things other than the war when they cast their ballots.