In "Silicon Valley," a new half-hour HBO comedy from the man behind "Beavis and Butt-Head" and the cult movie "Office Space," a mousy programmer named Richard ( Thomas Middleditch) finds himself at the center of a bidding war between two tech moguls. They covet a powerful algorithm that he created almost by accident. Should he sell his invention to a Google-like monolith for $10 million, or try to launch the start-up himself under the tutelage of an eccentric investor?

The quandary doubles him over with nausea. His doctor starts pitching the rising entrepreneur, coaxing him to invest in a device that distinguishes panic attacks from heart attacks.

Hollywood loves rags-to-riches stories, including its own, in which waitresses turn into movie stars. That most American of story lines has moved to Silicon Valley as it overshadows the entertainment industry as a center of power and money. Filmmakers are flocking north in search of material. When Facebook spends $19 billion to acquire WhatsApp, or the two founders of Snapchat turn down $3 billion in cash to sell their company, people pay attention—and feel ambivalent about the whole dynamic.

In movies and on television, techies long functioned as a two-dimensional plot device—socially inept computer nerds who help save the day (or wreak havoc) with a flurry of keystrokes. Now, there's a new geek in town. The stock character with the horn-rimmed glasses and bad haircut has been replaced by the fresh-faced app designer who becomes an overnight billionaire.

"Silicon Valley" pushes the story line into new comic domains, with some strong echoes of the real place. A billionaire investor offers to pay college students to drop out—an echo of billionaire PayPal co-founder Peter Thiel's fellowship program to launch new ventures—then he drives off in a car the size of a shopping cart. At a toga party, programmers struggle to make eye contact with some attractive women who chat them up, then discover that they're actresses hired to spice up the event.

"The Social Network," the 2010 film about Mark Zuckerberg and the founding of Facebook, proved that a story heavy on computer code could make for gripping drama. The team behind that film, producer Scott Rudin, writer Aaron Sorkin and director David Fincher, are now working on a biopic about Steve Jobs (not to be confused with a recent film starring Ashton Kutcher). In June, cable channel AMCAMZN-0.11% rolls out "Halt and Catch Fire," an early-'80s drama about an arms race in home computers. "Hatching Twitter," a book about the company's early days, is being developed into a TV series by Lionsgate.

Silicon Valley Drama

Thomas Middleditch and Josh Brener in the new HBO satire 'Silicon Valley' HBO

Still, for the denizens of Silicon Valley, many of whom grew up feeling misunderstood, there's an entrenched skepticism about portrayals by outsiders. "We all in some way were nerds when we were younger. It's hard to not be stereotypical—but not to the extreme Hollywood shows it," says tech entrepreneur Peter Pham.

Hollywood's view of techies has evolved in step with the general public's, which is to say haltingly. Movies like 1983's "WarGames" (starring Matthew Broderick as a computer prodigy who accidentally initiates a nuclear-war threat) and 1995's "Hackers" ( Angelina Jolie as a cyberpunk named Acid Burn) were essentially science fiction. Some of the behind-the-scenes rivalry in the computer world emerged in the 1999 made-for-TV movie "Pirates of Silicon Valley," starring Anthony Michael Hall as Bill Gates and Noah Wyle as Steve Jobs.

Michael Arrington, founder of the industry blog TechCrunch and a startup investor, went in expecting more of the same stereotypes. After seeing two episodes, he said the character types and the stresses they faced were "actually pretty dead on."

Chris Tsai, chief executive of Celery, a maker of e-commerce software, points out one difference between TV and reality. "There's a misconception that you just need a good idea and a little luck to start a rocket ship. It turns out that a majority of a startup's work is behind the scenes and not glamorous: Often it's three or four people grinding away in relative obscurity for a long period."

It's no surprise that Hollywood would forgo images of bleary-eyed programmers for more dramatic stories of overnight success. In reality such breakouts are relatively rare, says Adeo Ressi, founder of entrepreneur training programs TheFunded and the Founder Institute. "Silicon Valley creates as much or more failure than success—a few very successful companies built on the backs of broken dreams."

Indeed, the banal details of building a business can be deadly on the screen. "The Wolf of Wall Street" told its audience that some things were too complicated to explain, then toggled back to the racy action. In "Silicon Valley," by contrast, the plot hinges on computer code and business decisions, but the writers balance that with dirty jokes and blundering characters.

The Weissman Score

Just like a sports story, the HBO series 'Silicon Valley' needed to give viewers a way to keep score as they followed the development of some software at the center of the show. So the producers recruited engineers at Stanford University -- professor Tsachy Weissman and graduate student Vinith Misra -- to design a test for the fictional algorithm. In the show, tech moguls see big money in the program's ability to compress large chunks of data. Characters discuss 'the Weissman Score,' and use it to measure the improvement of their algorithm as the season unfolds. It should be noted: 'Silicon Valley' is a comedy. Credit: HBO

ENLARGE

One reason there are more detectives and doctors on television than engineers and tech entrepreneurs is that computer screens are chronically boring to watch. The reality TV series "Start-Ups: Silicon Valley" tried to solve that problem by delving into the flirtations and fights that the cast of aspiring entrepreneurs got into between pitch meetings with VCs. The show, produced by Randi Zuckerberg, Mark's sister, petered out after eight episodes on Bravo, the cable channel better known for its saucy "Real Housewives" franchise.

"It totally failed because it was too nerdy for mainstream America and it was too dumb for Silicon Valley," says Hermione Way, who was a regular on the show. An entrepreneur, she's now marketing a "wearable smart vibrator" controlled via mobile devices.

Another star of the show says the producers struggled to capture enough screen-worthy action. "The valley is boring. There are only a few places where you can eat dinner past 10 p.m. This is a culture optimized for working insane hours," says Kim Taylor, now chief executive of an education technology company called Ranku. "We're all searching for the club that Sean Parker went to in 'The Social Network'—no one's found it yet."

For some, the disconnect is probably permanent. When asked about the way tech culture tends to come across in pop culture, Sam Altman, president of incubator Y Combinator, replied in an email: "hmm..im not sure if I'm the best person to answer this. I dont have a TV and almost never see movies...but i assume they misportray :)"

On a business level, Hollywood's actual incursions into Silicon Valley have met with spotty success, from early-'90s misadventures with "interactive multimedia" to the ill-fated AOL-Time Warner combination. Now, as more subsets of the geek population are represented on screen, from macho programmers to TED conference gurus, the TV and film industry is increasingly merging with the tech business in the real world. Last month, Disney agreed to acquire Maker Studios, a network with a huge stable of YouTube stars, for $500 million. Netflix is angling for its second year in the Emmy nominations. Amazon.com recently backed a new round of original TV series.

Amazon's original series "Betas," a comedic drama about a social networking startup, hasn't been renewed after 11 episodes. The show got mostly positive online feedback but some viewers dismissed the portrayals and the cast with geek snobbery: "Hipsters with laptops and nerd glasses who couldn't code their way out of recursive function," wrote one commenter on Amazon.

There have been some inevitable overlaps among these productions. In the first episode of "Betas," the founders of the struggling startup, desperate for funding, crash a rich tech mogul's party, where the music star Moby is performing in the band. In the first episode of "Silicon Valley," rapper Kid Rock tries in vain to liven up a party as disinterested techies (and Google's Executive Chairman Eric Schmidt) look on.

In fact, both shows were filmed in Los Angeles and, coincidentally, shot on the same lot. "Every once in awhile the 'Betas' lunch wagon would park in my space," says Alec Berg, a "Silicon Valley" executive producer.

He, like Mr. Judge, feels grounded in the geek world. His father is a Harvard biophysicist and his brother and sister-in-law are veterans of Microsoft. "I've been very immersed in socially awkward nerd culture my entire life. Mike's the same way. The rhythms and idiosyncrasies of those guys are very familiar to us," says Mr. Berg, a writer and executive producer on "Seinfeld" and "Curb Your Enthusiasm."

In the show, Richard's invention promises "universal lossless compression"—meaning it can squeeze down big hunks of data for quick transfer and no compromise in quality. A dozen consultants, including six computer programmers, supplied jargon about "filter banks" and "prediction loops" for the dialogue. A team at Stanford University invented a test for Richard's algorithm. Jonathan Dotan, a Web entrepreneur recruited to lead the consultants, pitched the fictional startup company to real venture capitalists to make sure it sounded like a juicy investment.

ENLARGE

WSJD is the Journal's home for tech news, analysis and product reviews.

Costume designer Daniel Orlandi, who interpreted the Valley's uniformly casual dress code, refers to hoodies as the tech world's sport coat—it can be dressed up or dressed down. (For Richard, they preferred a version from Urban Outfitters.) Because of a sort of "reverse-snobbery" in effect, he said, even the ultrarich dress inconspicuously. For one billionaire character, he chose an expensive workout outfit from Ralph Lauren's Black Label line that pretty much looks like an ordinary black sweatsuit.

Producers argue that such attention to detail helps buttress the satire. Their targets include the phony altruism rampant in the Valley (where every app has the potential to "make the world a better place"), and lifelong introverts who end up as power-wielding bosses. In one scene, a face-off between the rival tech moguls (played by Matt Ross and Christopher Evan Welch, who died before production ended) results in little more than stilted small talk.

"That was our Godzilla vs. Mothra moment," Mr. Berg says. "In doing all the research, the term passive-aggressive kept getting lobbed around. There's a lot of blustery types in the Valley, but nobody there is going to throw a punch."

The producers say they have a deep respect for the population they're skewering. "That's what is so great about this terrain," says Mr. Berg. "There are some great people making incredibly cool things, and there are some egomaniacs and jackholes out to knife each other. And when you start pouring sacks of money on top of all this, it becomes fascinating."

It is difficult to show the creative process because most of the work goes on inside a person's head. The best way to achieve dramatization is to use an objective correlative - some symbol that acts as reference to the creative act.

Another method is to create a conflict that involves the creative process being depicted. A recent good example is the movie "The Words." A writer accidentally comes across another writer's unpublished novel and passes the manuscript off his own. The book becomes a runaway success. The conflict that drives the story arrives when the actual writer contacts the impostor and accuses him of having stolen his life, in a way.

Something more than a success story with quirky characters is needed to dramatize work life in Silicon Valley, even for a comedy.

I like dramas set in work situations and am tired of shows about lawyers, cops and dead bodies. There were some good shows like Boston Public, about a high school, and one years ago about an architect. I'm going to check out this show.

There's this thing called a glass ceiling... and unfortunately its real.

There's the law that says when you get to be over 50 employees, you need to have X number of female employees. In terms of geek / technical factor... the ratio of male to female is skewed greatly towards men.

Why? Because women are smarter and avoided computer programming for different careers.

This copy is for your personal, non-commercial use only. Distribution and use of this material are governed by our Subscriber Agreement and by copyright law. For non-personal use or to order multiple copies, please contact Dow Jones Reprints at 1-800-843-0008 or visit www.djreprints.com.