If Hillary Clinton is elected president in November, her very first thank-you should go to Bernie Sanders.

“What?” you ask. “How could she thank Sanders when his vigorous campaign took people away from her natural and expected support groups– progressive women, young African Americans, and other liberals?

“He is smearing her for the Clintons’ ties to big banking and big business. And for her earlier support of international trade agreements that are so unpopular with some workers’ groups.

“And,” you assert, “he is pushing her too far to the left on positions that will hurt her with moderate or swing voters in the fall.”

You may be right about these things. But Bernie Sanders is doing something for Hillary Clinton that greatly improves her chances for success in the fall.

He is giving her a fight. And with that fight behind her, she will be much better equipped for the challenges in the general election.

Eight years ago, during the primary battles between Clinton and Barack Obama, I wrote about the advantages of that struggle. Here is what I wrote back then, with a few minor revisions: I think the hard-fought primary campaigns, negative advertising and all, may be the Democrats’ best possible preparation for the fall campaign. Conceding, of course, the downside in bitter feelings and lowered popularity of the ultimate candidate, I think the organizational process, the fundraising experience, and the challenges the candidates have faced, are good preparation for the ultimate Democratic nominee. An easy win for either would not have conditioned the winner for the political war that the nominee will have to fight this fall. Political coronations may encourage happiness and good feelings within a party, but the muted campaigns that lead up to them do not build the kind of experienced organizations that will be so valuable to the nominee in the general election.

When the Democratic candidate goes to war this fall, the campaign’s armies will have been battle-tested. The organization will know the terrain of the entire country, and the troops will have the confidence of hardened veterans who have already fought together and learned the strengths and weaknesses of their fellow soldiers. They know who can help in every part of the country, and, more importantly, they know the people who actually can be counted on to do the job.

One caution: The hard knocks the Democratic candidates have exchanged this year so far are nothing compared to what the nominee will experience in the general election.

In my earlier column, I quoted Time magazine columnist Joe Klein’s discussion of the necessary qualities of a presidential candidate, “It helps to be a warrior, for one thing. It helps to be able to take a punch and deliver one–even, sometimes, a sucker punch.”

Those sucker punches are surely coming and the Democratic candidate will not have had as much practice in the primaries as the Republican in taking or delivering such punches.

If Donald Trump is the Republican nominee, nothing in the Democratic primaries will have given Hillary (or Bernie) experience in responding to the punches he has shown us that he can deliver. Not just sucker punches, but underhanded, low, dirty, and other sneaky ones as well.

In the general election campaign, the Democratic candidate will have to respond to Trump with effective counter punches. Will the response be, like those of Marco Rubio and Ted Cruz, to jump in the mud with Trump and exchange childish insults?

Hopefully not.  It will be better if those counter punches will, like those between Clinton and Sanders, be sharp and pointed, but not undignified.

A good lesson from the Democratic primaries and one more reason for Clinton to be grateful to Sanders if she wins in November.