Of late, there has been much hand-wringing over statements by various Republican presidential candidates as to whether or not George W. Bush's war in Iraq was a mistake. Without addressing whether or not the war was inherently a mistake, the focus on that issue by those excoriating the various candidates defending the war sidesteps the issue of how the war was fought.
Discussing the merits of alternate ways of fighting the Iraq War is about more than being able to say that the war might not have turned out so bad if only it had been fought more smartly, though I am of the opinion that that is the case. It is also a matter of drawing the correct lessons from the war, lessons with consequences for how we approach the conflicts presented to us today that cannot be avoided.
Saying that the Iraq War was irredeemably a mistake and that no alternative approach to it would have changed that is saying that how the war was fought is irrelevant. If how the war was fought was irrelevant, then all that matters in war in general is whether or not to fight, and if so, how much force to bear. If that is the case, then all that matters in the conflict with Isis is bringing enough force to bear. If all that matters in fighting Isis is applying enough force, then there is no reason not to outsource the application of that force to Iran.
However, if your lessons from the Iraq War have to do with how it was fought, rather than the simple fact that it was fought, then one clear lesson is to avoid aligning yourself with those who pit one part of the population against another. In this regard, Iranian-aligned government of Iraq clearly pits Shia Iraqis against Sunni Iraqis, giving the latter no reason to support the overall state. A result of this is that the Sunni sections Iraq have become fertile ground for Isis takeover because while the locals might detest Isis, they detest the Iranian-aligned national government even more. The result is that while the Iranians might be able to remove Isis from a stronghold here and there tactically, they cannot remove the root cause of those strongholds' receptiveness to Isis because they are the root cause of those strongholds' receptiveness.
This brings up the entire justification for Obama's engagement with Iran. Obama claims that we need to go easy with Iran on nuclear negotiations and their sponsorship of instability across the world because we need their help against Isis. However, if Iran is part of the problem in terms of making the region hospitable to Isis, then there is no reason to include Iran in the coalition against Isis, let alone yield so ground in negotiations in order to procure that inclusion.