Editor’s Note: Julian Zelizer is a professor of history and public affairs at Princeton University and a New America fellow. He is the author of “Jimmy Carter” and “The Fierce Urgency of Now: Lyndon Johnson, Congress, and the Battle for the Great Society.” The opinions expressed in this commentary are his.

Story highlights

Sanders is keeping it competitive, but even if he loses, he will have a powerful effect in November, writes Julian Zelizer

He says Sanders has forced Clinton to adopt stances that will appeal more broadly to the Democratic base

CNN  — 

Bernie Sanders’ campaign gained new momentum with three commanding victories this weekend in Washington, Hawaii and Alaska. While Hillary Clinton maintains a comfortable lead in the delegate count, it looks as though it’s going to be a long time before she can close this race. Sanders continues to excite, to inspire and, most importantly, to win.

A key test will be the April 19 primary in New York, a state with a large population of minority voters, a group that has favored Clinton in other big contests.

The success of Sanders has been a huge surprise and disappointment to Clinton and her supporters. The once inevitable nominee has been forced to run in an extremely competitive primary against a challenger who has exposed many of her flaws and weaknesses.

Still, in the long run, Sanders may turn out to have been one of the best things to have happened to Clinton’s campaign.

Assuming that she does win the nomination, Clinton will emerge as a much stronger candidate and her campaign operation will be in a better position for the fall, thanks to Sanders’ insurgency. Unlike divisive primaries that hurt a political party – such as Sen. Ted Kennedy’s challenge to President Jimmy Carter in 1980 or, most likely, the internecine battle that is ravaging the GOP this year – the Democrats will benefit as a result of the past few months.

How has Sanders helped? How could it be that the constant attacks on Clinton’s domestic record, her connections to Wall Street and her judgment as a leader leave her in better shape than when she started? How can the sweeping wins in the West be anything but bad for the front-runner?

Economy and inequality are front and center

Thanks to Sanders, economic issues are now front and center in this campaign. While Sanders may be a single-issue candidate focused on inequality, it’s a really big issue that he has dealt with. And it’s one which, as the campaign in both parties has revealed, really resonates at this moment in history. Americans are tired of, and scared by, the growing economic divisions in our society as well as the insecurity that faces middle-class families.

In response to Sanders, Clinton has taken a stronger stand on these economic issues and worked harder to demonstrate her commitment to addressing these challenges if she should be elected president. Sanders has created room for Clinton, who has been a centrist Democrat, to be more unabashedly liberal in response to this problem, and this will help her.

Economic security is an issue that Democrats have historically done well with. This issue was at the heart of the New Deal, the formative period for the modern party.

Clinton has also responded to Sanders by clarifying other kinds of issues that will be central to her presidency. In her effort to distinguish herself from the senator, she has spoken much more about other issue areas that she would address, including the central questions of racial and gender inequality. Even if the government addressed economic inequality, she said, “we would still have racism holding people back. We would still have sexism preventing women from getting equal pay. We would still have LGBT people who get married on Saturday and fired on Monday.”

She has slowly crafted a set of arguments around a potential presidency that would address the multiple sources of division within this country. Doing so offers a path toward building a broad and diverse political coalition.

Building on Obama’s gains

While Sanders offers a much more coherent political vision, Clinton has slowly developed an argument about her belief in pragmatic liberalism, which will hold considerable appeal to voters who are seeking real gains in the coming four years. With Sanders offering bold ideas like single-payer health insurance, Clinton has positioned herself as a liberal Democrat who understands that she will have to operate in a very conservative political world.

This has pushed her to champion an argument about the ways that she would solidify and expand the gains that have been made under President Obama and move into new policy areas with specified and realistic measures. For many constituencies that are desperate to keep the programs that Obama achieved and hoping for more assistance, this argument can resonate.

For instance, Clinton proposes strengthening Obamacare with measures like a $5,000 per family tax credit to reduce the amount that Americans have to pay for premiums and out-of-pocket charges. She also would like to ensure that Americans could have three sick visits every year to their doctors without having to meet a deductible. She would also continue Obama’s policy of providing federal money to match the spending of states which expand Medicaid, while investing in outreach programs to help individuals enroll.

Sanders took the high road

One of Sanders’ biggest decisions was to keep the debate focused on policy rather than personality and character. Although some of his supporters have been frustrated that he has not gone after issues like the Clinton email scandal, the net result was to elevate the quality of the discourse within the Democratic Party.

With the GOP embroiled in a low-level discussion that has even degenerated into comparing the photographs of spouses and the size of a candidate’s hands, the Democrats have appeared as the adults in the room (even if not as much fun to watch) with a series of debates over policy. Democrats debate whether the regulatory approach of the Affordable Care Act or a single-payer health care system is more effective, at the same time that Donald Trump and his rivals engage in debates that are as far from presidential as they can be.

The ability of the Sanders campaign to mobilize Americans who have been alienated from politics can have very positive ramifications in the fall. He has inspired the progressive coalition of the Democratic Party – which is a powerful, mobilized and motivated group that Democratic candidates have too often ignored in recent decades.

Key test for Clinton

If Clinton can find a way to sustain the support of the movement that Sanders has built, and if Sanders is willing to join forces with Clinton in the fall, this can be an extraordinarily effective electoral tool, particularly in swing states like Ohio and Florida. In 2008, Obama showed just how powerful new voices could be in determining the outcome of an election. If Clinton and Sanders can prevent voters, like younger Americans, from leaving the system once again, they could become part of a winning coalition in November.

This won’t be easy. Clinton will have to work hard, reaching out to Sanders supporters and working with the senator himself to avoid squandering this opportunity. Through her vice presidential selection and word of potential cabinet picks, as well as concessions in the party platform, she will have to convince his followers that her appeals to his issues are more than campaign rhetoric.

Finally the Sanders campaign was an early wake-up call for the Clinton team which, as in 2008, was running an incredibly sloppy and unstructured operation that was counting on Clinton’s experience and intellectual skill to be enough to win the race.

As it became clear that Sanders posed a very serious threat, the Clinton team has done a much better job in terms of its organization, its media work and its messaging. When this race ends, the Clinton campaign will be in much better place to take on Donald Trump or any other Republican in what is likely to be an extraordinarily nasty race.

If Hillary makes it all the way to the White House in 2017, she can look back with appreciation to the role that Bernie played.

Join us on Facebook.com/CNNOpinion.
Read CNNOpinion’s Flipboard magazine.