Sen. Bernie Sanders (I-Vt.) on the campaign trail in Boulder, Colo., this past Saturday. (Cliff Grassmick/AP)

Bernie Sanders and Jeremy Corbyn are liberal politicians separated by an ocean but united by a common fashion sense. Or maybe it’s a fashion non-sense.

Sanders, for president, has an almost Einsteinian nebula of white hair and is prone to wearing suits that look as if he pressed them under a mattress. His clothes seem to hang on him, as if he borrowed them from another man’s closet. Sanders strongly suggests Oscar Madison, albeit with a more detailed college-tuition plan.

Corbyn, the new leader of Britain’s Labour Party, isn’t likely to make the cover of GQ anytime soon, either. Like Sanders, he typically appears in public in dress shirts that have been through a few too many wash cycles. On the irregular occasions in which he wears a tie, he tends — trigger warning, fops! — to leave the top button of his shirt undone. Perhaps most suspiciously, at least to Britain’s conservatives, he dares to sport a beard.

Um, sir? Your collar? Jeremy Corbyn at the annual Labour Party conference last month. (Leon Neal/Agence France-Presse via Getty Images)

Now, let’s stipulate that clothes and hairdos are irrelevant to any candidate’s ideas, competence or fitness for office. Or, should be. But they do matter — if only in how they feed the public’s perceptions. And the surging popularity of both men offers a living commentary on our expectations, and prejudices, about gender and age.

Corbyn and Sanders violate the male politicians’ Uniform Code of Fashion because they can. Their age and gender (and perhaps their race) give them cover to flout expectations. Older men — Sanders is 74, Corbyn is 66 — get a pass largely because we don’t place the same value on their physical being.

That gives them license to make these perceived anti-fashion statements — which, of course, are read among their passionate supporters as evidence of their political “authenticity.” It’s part of what makes them seem different to the faithful, and therefore preferable. They’re the aging college professors, too busy conjuring Big Ideas to care about such trivialities as clothes and hair. They’re not, in a word, “slick.”

“The real difference [between Sanders and Hillary Rodham Clinton] is that Hillary Clinton has professional image handlers” to advise her, Jon Stewart said on “The Daily Show” in June, after Sanders announced his candidacy. In Stewart’s telling, that made Sanders his own man: “The problem isn’t that Bernie Sanders is a crazy-pants cuckoo bird, it’s that we’ve all become so accustomed to stage-managed, focus-group-driven candidates that authenticity comes across as lunacy.”

Oh, really? Ask yourself this: Could Clinton or Carly Fiorina pull off a similar look and be taken as seriously as Sanders? More important: Could Jeb Bush or Marco Rubio or Rick Santorum?

Female candidates such as Hillary Clinton draw more scrutiny of their appearance than men. (Lynne Sladky/AP)

Carly Fiorina at a campaign event. Women running for office must appear virtually regal to stand a chance. (Michael Holahan/The Aiken (S.C.) Standard via AP)

Clinton and Fiorina already get enormous scrutiny of their clothing, hair and makeup, as all female politicians do. (Fiorina called out Donald Trump’s comments about her appearance in the most recent GOP debate.) It’s unfair, of course, but all female candidates know they have to look perfect when they appear in public. An “older” female candidate practically needs to seem regal to stand a chance.

But male candidates younger than Sanders or Corbyn face some of these pressures, too. If Bush or Rubio or, say, Democrat Martin O’Malley appeared in public with his hair and clothes askew, he wouldn’t be called “authentic” or “real” — he would be dismissed as disorganized.

We’ve come to expect male candidates of a certain age to conform to a fairly narrow physical range and type, too. The basic male political uniform includes a dark suit (not too tailored, please), a red or blue tie, a crisp white or blue dress shirt (top button closed, thank you), and short hair (sorry, no beards or ’staches). The funkiest the fellas ever get on the campaign trail is when they take off the tie and suit jacket and roll up their sleeves. (Sanders was at his sartorial best in the Democratic debate Tuesday night, with a dark suit and blue-striped tie.)

So, everyone got the memo about the dress code? Marco Rubio, Jeb Bush and Ben Carson at the August GOP debate in Cleveland. (Andrew Harnik/AP)

As an upstart candidate in 2007, Barack Obama never had a choice in how to dress. Relatively little-known, and an African American with an exotic name to boot, he must have been aware that any un­or­tho­dox style choices would provide his opponents with one more way to paint him as “different.” We tend to read conservative attire as evidence of probity, intelligence and sound judgment, which is why bankers, surgeons and pols carefully manage the way they look.

But in the right hands, a bit of counterprogramming can work, too.

Face it: There’s something voters just don’t like about politicians who spend too much time attending to their appearances. Remember the video of then-Democratic presidential contender John Edwards endlessly primping his hair before a TV appearance? It was all downhill from there.

Joe Biden and Barack Obama at the 2007 Democratic debate in South Carolina, staying well within the lines of acceptable men’s fashion. (J. Scott Applewhite/AP)

Never a hair out of place: John Edwards on the stump in Iowa in 2007. A video of him grooming gave critics fuel to paint the candidate as shallow. (Keith Bedford/Reuters)

But that’s no more fair than the opposite — the notion that a shambling appearance is evidence of depth and selfless commitment to principles.

The liberal Guardian newspaper recently defended Corbyn’s politics by swooning over his Soviet-era wardrobe: “There are still the Corbyn touches — the unruly hair, and shirts in non-committal shades of blah. But alongside the exposed vests — bought, he said, at a market stall for £1.50 a pop — there are also the Beckham baker caps, the colour-blocked sweatshirts and beige Harrington jackets. The change has been gradual but real. Still, he was and remains five-time winner of parliamentary beard of the year, and until that goes, he’ll always be Jeremy Corbyn, the man with no iron — and there’s no shame in that. He’s busy.”

Did we mention that he rides his own bike to events? That’s part of Corbyn’s look, too. (Peter Nicholls/Reuters)

“Corbyn dresses abysmally,” the British Independent newspaper’s fashion critic gushed. “That’s a great thing. It’s great because it’s genuine.”

U.S. writers can’t get past Sanders’s exterior, either. (Guilty!) He is regularly described as “gruff” or “disheveled” — and sometimes “gruff” and “disheveled” — in profiles and news stories. But these aren’t meant as put-downs. They’re supposed to be signifiers that he’s “honest,” or at least different from the rest of the pack.

If his ragged look is part of his personal branding, you’ll probably never get Sanders to admit it. When the New York Times asked him, somewhat playfully, whether it’s fair that “Hillary’s hair gets a lot more scrutiny than yours,” he seized the opportunity to scold the reporter for all the superficial sins of the corporate media he loves to disparage.

Never mind that the real point of the question was the double standard facing women in politics. And never mind the fact that Sanders’s distinctively unruly white corona has become a badge of his outsider credentials, embraced by his supporters in memes and unofficial logos .

Sometimes they call him “gruff.” Sometimes they call him “disheveled.” Sometimes they call him “gruff” and “disheveled”: Sanders at a campaign rally in Springfield, Mass., this month. (Michael Dwyer/AP)

In short: Sanders’s untamed locks, like Corbyn’s undone buttons, are today’s equivalent of that hole in Adlai Stevenson’s shoe.

In 1952, Stevenson, the governor of Illinois, was preparing to give a speech shortly after winning the Democratic nomination for president when a newspaper photographer snapped a picture of him sitting onstage with his legs crossed.

The most striking feature of the photo: the spot on the sole of his upraised wingtip that was worn clear through.

Gov. Adlai Stevenson in the famous 1952 photo from the campaign trail, with Michigan Gov. G. Mennen Williams, left, in Flint, Mich. (William Gallagher/Flint (Mich.) Journal via AP)

The photo was a sensation, republished across the country; the photographer, William Gallagher of the Flint (Mich.) Journal, won a Pulitzer Prize for it. An embarrassment for Stevenson? Hardly. His campaign advisers reportedly loved it: It gave the wealthy and aristocratic Stevenson the kind of guy-next-door cred he might have otherwise lacked and cemented his legacy as a beloved liberal icon.

Of course, anti-fashion statements only go so far. Stevenson lost the presidency — twice — to a stolid, steady and never less than spit-polished Republican named Dwight D. Eisenhower.