There are no perfect analogies in politics, but one worth considering at this moment is the comparison between Joe Biden’s campaign for the Democratic nomination and Mitt Romney’s bid for the Republican nomination in 2012.

Biden has hit another rough patch after several small flubs while campaigning in Iowa last weekend. He claimed he was vice president when the Parkland school shootings occurred. (The shootings took place in 2018.) He said he prizes “truth over facts.” (He usually says it correctly, as “truth over lies.”) He said, “Poor kids are just as bright as white kids.” (Though he immediately caught himself to add “wealthy kids, black kids, Asian kids.”)

He’s made other small mistakes of language, and in most cases has caught himself. Many voters (though not all) don’t seem to care about this, but the coverage of his campaign has now focused on the idea that he is, as he once said of himself, “a gaffe machine.” (When he described himself that way, it was to contrast himself favorably with President Trump, saying a few gaffes hardly compare with someone “who can’t tell the truth.”)

The latest thread of coverage comes after earlier bumps in the road for the former vice president. He was subpar at the first Democratic debate in Miami, even beyond being unprepared for an attack from Sen. Kamala D. Harris (D-Calif.). At the second debate, he tangled with Harris and Sen. Cory Booker (D-N.J.). He did better but was hardly a commanding presence.

Harris’s attack came after stories recounted Biden’s position opposing mandatory busing in the 1970s and after he had talked about working cooperatively to get things done in the Senate and, inexplicably, cited his work with two segregationist senators back in the old days. (For that, he eventually apologized, after first resisting.)

Meanwhile, he continues to lead in the polls, nationally and in early states. He has led those polls from the start of the year to today. Still, he is treated as being in a precarious position, a vulnerable candidate not at his best and a few mistakes away from a real fall.

Just like Romney through much of 2011.

Romney was the disrespected front-runner in the 2012 Republican field. He could be awkward as a candidate and paid a price for it in the coverage of his campaign. But as with Biden, he led in most — not all — surveys ahead of the primaries and caucuses.

He did fall into second place in the polls in the early fall of 2011, after then-Texas Gov. Rick Perry got into the race. But Perry quickly collapsed after a push from Romney and his famous “oops” debate moment, when he blanked on one of the federal agencies he wanted to eliminate.

Romney was running in a Republican Party that was absorbing the impact of a rising and noisy tea party movement. He was described as out of step with a party that was moving swiftly to the right. He presented himself as a conservative, and his positions were generally conservative, including on immigration, so much so on that issue that it compromised him in the general election. But many conservatives regarded him with suspicion.

The principal criticism from the right was that he had helped to engineer the successful passage of a health-care program in Massachusetts that bore a strong resemblance to the later-passed Affordable Care Act. He fought constantly against such comparisons, including a tutorial at a campaign event designed to end the discussion. He struggled to shake free of those attacks.

Biden finds himself in a somewhat similar situation today. The Democratic Party has moved to the left since he became vice president under President Barack Obama. As a senator, Biden was in what was then the party’s liberal wing. In the new party of 2019, he has been outflanked on the left by rivals such as Sens. Elizabeth Warren (D-Mass.) and Bernie Sanders (I-Vt.). He’s been attacked for the 1994 crime bill he championed and for his 2002 vote to authorize the Iraq War.

Biden opposes Medicare-for-all, which is supported by Warren and Sanders and others. He prefers more incremental change at a time when the party’s left wing wants something bigger and bolder. He is hardly a centrist, but in the ideological conflict of the nomination battle, he cannot satisfy those in the most progressive wing.

Through much of 2011, Romney’s polling numbers were far from impressive. His RealClearPolitics average in the summer of that year was between 20 percent and 25 percent. In Washington Post-ABC surveys that summer and fall, he was always in the range of 25 to 30 percent among registered voters.

Romney faced serial challengers. Perry was the first. Then there was business executive Herman Cain, and then twice it was former House speaker Newt Gingrich, the first time at the end of 2011 and a second time after he beat Romney in the South Carolina primary. The last to move ahead in the RealClearPolitics average was former senator Rick Santorum of Pennsylvania, who eclipsed Romney briefly in February 2012.

Biden has yet to hit that kind of adversity. His best showing so far in the RealClearPolitics average was about 40 percent support immediately after he announced his candidacy in late April. That support fell to a low of about 26 percent in early July, shortly after the Miami debate. He now sits around 30 percent nationally. But even at his lowest this summer, he was maintaining a margin of about 10 to 12 percentage points over his nearest rivals.

Most of Romney’s challengers were flawed. Perry looked ideal on paper but was not up to the rigors of a presidential campaign. Gingrich came with considerable baggage from his days as speaker. Santorum had lost his reelection campaign in Pennsylvania by a wide margin in 2006. Cain was ill-suited for the presidential stage.

Biden’s challengers appear to be more substantial. Sanders gave former secretary of state Hillary Clinton a tough challenge. Warren has discipline and a robust package of progressive initiatives. Harris has personal magnetism and prosecutorial skills. South Bend, Ind., Mayor Pete Buttigieg has developed a following with his intelligence and temperament. Booker has passion as a campaigner that few others can match. Time and the rigors of the campaign will prove which are and aren’t up to giving Biden a real challenge.

Romney was a well-prepared debater, willing to take down an opponent when he needed to do so. Biden has yet to show those skills on the debate stage and has been uneven on the campaign trail. He has yet to fully face down an opponent on the verge of overtaking him. But he has more good will across the party than did Romney.

The Romney experience shows how a candidate who leads the polls but gets only nominal respect can prevail in a nomination contest. But that long campaign also left him branded and weakened for the general election against Obama. Biden’s task will be to show that, whatever missteps and misstatements he might make, he is better than any of the others seeking the nomination — and do that in a way that does not weaken him for a general-election campaign against a president who plays by nobody’s rules but his own.