“I believe the really good people would be reasonably successful in any circumstance,” the detective writer Raymond Chandler wrote in his notebook in 1949. If Shakespeare came back today, “he would have refused to die in a corner.”

Shakespeare, Chandler theorized, would have gone into the movie business and made its tired formulas fresh. He wouldn’t have cared about the vulgarity of Hollywood, Chandler thought, “because he would know that without some vulgarity there is no complete man. He would have hated refinement, as such, because it is always a withdrawal, a shrinking, and he was much too tough to shrink from anything.”

Chandler had a tough, urban sensibility, and he created his own vision of the complete modern man, especially in the image of his most famous character, Philip Marlowe. Every new type of hero is like a new word added to the common vocabulary. It gives people a new possibility to emulate and a new standard of excellence. Chandler succeeded in giving his era a compelling male ideal.

Chandler was not particularly kind to women, though. It was up to director Howard Hawks and his star, Lauren Bacall — who died this week — to give that era a counterpart female ideal, a hero both tough and tender, urbane and fast-talking, but also vulnerable and amusing.

Vivian Rutledge, the lead female character in the movie version of Chandler’s “The Big Sleep,” is stuck in a classic film noir world. Every situation is confusing, shadowed and ambiguous. Every person is dappled with virtue and vice. Society rewards the wrong things, so the ruthless often get rich while the innocent get it in the neck.

The lead character, played by Bacall, emerges from an ambiguous past, but rises aristocratically above it. She has her foibles; she’s manipulative and spoiled. But she’s strong. She seems physically towering, with broad shoulders and a rich, mature voice that is astounding, given that Bacall was all of 20 years old when she made the picture.

She projects a hardened wisdom about the way the world works, and an ironic gaze. Her most outstanding feature is near perfect self-possession. She is composed and self-assured under stress. You get the sense that she has spent her life effortlessly wrapping men around her fingers. Her self-command must have seemed simultaneously masculine and feminine at the time.

The movie’s plot is famously incomprehensible. But you get to watch Vivian meet her equal. The badinage between Bacall’s Vivian and Humphrey Bogart’s Marlowe is a cross between swordplay and foreplay. (They were married during the drawn-out filming process.)

The heiress greets Marlowe with a put down, “So you’re a private detective. I didn’t know they existed, except in books, or else they were greasy little men snooping around hotel corridors.”

But he’s self-sufficient enough to stand up to her. He wins her over with a series of small rejections. And he can match her verbal pyrotechnics. When she says she doesn’t like his manners, he comes straight back at her: “I’m not crazy about yours. ... I don’t mind if you don’t like my manners. I don’t like them myself. They’re pretty bad. I grieve over them long winter evenings.”

A connoisseur of love games, she’s soon enjoying the competition. The verbal dueling becomes a way of testing each other’s composure and finally turns into pure come-on, which, of course, she leads. The most famous exchange in the movie is allegedly about horse racing:

Bacall: “Speaking of horses, I like to play them myself. But I like to see them work out a little first. See if they’re front-runners or come-from-behind. ... I’d say you don’t like to be rated. You like to get out in front, open up a lead, take a little breather in the back stretch and then come home free.”

Bogart: “You’ve got a touch of class, but I don’t know how far you can go.”

Bacall: “A lot depends on who’s in the saddle.”

By the end, they are united by a moral sensibility. Both characters are constantly making character distinctions, identifying who’s legit and who’s not. The distinctions that matter in their world are not between rich and poor, or pure and impure; they are between those who are faithful to the code of their professions and those who aren’t; between those who are loyal and honest and those who are petty, snobbish and phony.

The feminine ideal in “The Big Sleep” is, of course, dated now. But what’s lasting is a way of being in a time of disillusion. At a cynical moment when many had come to distrust institutions, and when the world seemed incoherent, Bacall and Bogart created a non-self-righteous way to care about virtue. Their characters weren’t prissy or snobbish in the slightest. They were redeemed by their own honor code, which they kept up, cocktail after cocktail.