Make no mistake: The only similarity between HBO’s new drama “Deadwood” and the network’s recently retired hit “Sex and the City” is the characters’ predilection for words referring to male genitalia. New York was once a rough and tumble town, but if Carrie Bradshaw and her posse of gossipy girlfriends were to face-off with Deadwood’s Seth Bullock, Wild Bill Hickok or Calamity Jane, there is little doubt as to who would emerge victorious. Stilettos don’t work well in the mud.

“Deadwood” may open with black and white photography and fiddle music reminiscent of Ken Burns’ documentary “The Civil War,” but there’s a reason the show is running alongside “The Sopranos” and not playing on the History Channel.

Set in the historic town of Deadwood in the Black Hills of South Dakota, the first episode jumps right into the messy business of law and disorder, involving a hanging, a murder, a beating, and some very hungry pigs.

But viewers expecting John Wayne to ride into town will be sorely disappointed. As David Milch ’66, “Deadwood” creator and former Yale English lector, is quick to point out, the series is not a Western in the traditional sense of the genre. In fact, Milch said he devoted no time to watching old Westerns as a part of his research.

“The genre itself had no particular attraction for me,” Milch said. “I like to think of this story as set in the West, rather than a Western.”

In many ways, Milch — whose credits on the series include Head Writer and Executive Producer — is a creator of genre, rather than a mere copier, more inclined to break down cliches than operate within them. The Emmy-winner pioneered fresh ground with the television stalwart “NYPD Blue,” putting a new spin on cop drama.

Milch has traveled a long way since the heyday of “NYPD Blue,” but his fascination with the drama of law patrol can be traced through to his work on “Deadwood.” At first, Milch said he proposed a show about cops in Nero’s lawless Rome to HBO executives. When it turned out the network already had some Roman flavor on its plate, Milch’s attention was redirected to the Dakota Territory in the 1870s.

“The theme that engaged me was ‘how does society organize itself in the absence of law?'” Milch said.

It was this fascination with lawlessness that drew him to Deadwood, a boomtown in which every citizen was inherently a criminal because the town existed outside the reach of the United States government.

“What interested me was the particulars of that community,” Milch said. “They knew that if they passed laws they would be taken as a rival republic, like California and Texas.”

In “Deadwood,” where the cuss words flow as freely as the whiskey, there are no traditional heroes; “good” and “bad” are relative terms.

Not that Milch has departed so far from traditional storytelling. Most of the characters seem squeaky clean in comparison with saloon owner Al Swearengen, whom Milch said he probably modeled from Shakespeare’s nefarious Falstaff from “Henry IV,” which Milch read before beginning work on “Deadwood.”

For Milch, who honed his artistic skills at Yale under the tutelage of such literary giants as Robert Penn Warren and Cleanth Brooks, nothing matters so much as getting the story artistically “right.” In preparation for creating “Deadwood,” Milch steeped himself in historical documents from Deadwood, from which he gleamed the excessive foul language used in the series.

“This is the way the people in the community talked because they viewed themselves as criminals,” Milch said. “My fervent hope is the audience will begin to see that vocabulary as part of that world.”

Milch said the experience of writing for HBO, rather than mainstream network television, was liberating because the company allowed him to “get the story right” with little interference.

“Creating something for HBO is very different than anything [else], whether cable or network,” Milch said. “They have a belief in the autonomy of the artist.”

Because HBO is subscription based, it gets away with less censorship. Over the past five years, it has experience unprecedented critical and popular success. “Deadwood” is the latest of its acclaimed series.

“When I wrote ‘NYPD Blue,’ ABC refused to air it for a year,” Milch said. “There was so much fear permeating the creative atmosphere.”

In fact, despite his amazing success, Milch himself is somewhat of an outlaw. The Washington Post called Milch a “maverick genius” — a man who runs against the entertainment industry’s grain.

Milch, while freely acknowledging his unorthodox practices (he said he writes scripts at the last minute, a show-biz no-no), does not take such labels too seriously. In a business where the bottom-line is the most important, hitting the target is all that matters.

“If your series gets good ratings, you’re a maverick, and if [it gets] bad ratings, you’re a misfit,” he said.

Living outside the law has not yet hurt him.

“This is a business dominated by fear and imitation,” Milch said. “It’s not bad to be perceived as someone who goes his own way.”

[ydn-legacy-photo-inline id=”1106″ ]