Where is the dividing line between reality and entertainment in HBO’s “Silicon Valley”?

Turns out there’s a lot of truth behind the stories the comedy about life in the Valley’s frenzied startup culture.

Former tech journalist for Newsweek and Forbes and scriptwriter for HBO’s “Silicon Valley” comedy, Dan Lyons, offered a lot of jokes and a handful of lessons for startups from the show on Wednesday as CED’s Tech Venture conference came to a close.

He said most of the show’s best material is about venture capitalists. He quoted the famous line that “Private equity is like sex. When it’s good, it’s really, really good. When it’s bad, it’s still pretty much good.”

He tried to explain what VCs do to his son this way: “You give money to this group of people you get to work like dogs for years and if they succeed you own the company and get rich. If they just break-even you still do ok and if fails, who cares? It’s not your money.”

Lyons said the show’s writers actually spend a week in Silicon Valley each season at incubators and bars and restaurants where entrepreneurs hang out. “They make a huge effort to make sure it’s as accurate as possible.”

“You wouldn’t think you could get business lessons from a show as raunchy as this one,” Lyons added – then proceeded to suggest a few.

“Be careful taking money,” for instance. “Be careful who you’re getting in bed with, they’re not necessarily your friends,” he said. In one show, for instance, the venture capitalist funding its product demote the founder/CEO to CTO – a not unusual occurrence in the real world.

Another lesson: It’s easy to game your startups numbers. “One of the great dangers of digital marketing,” he said, “is that the data is so easy to game. You can trick yourself into believing something.” In the show, for instance, when a product doesn’t produce enough daily visitors to its app, it hires a click farm in Bangladesh – and gets caught.

“The best marketing is the product itself,” he said.

As the CED event closed,Grotech Partner Don Rainey, co-chair of the conference, recommended reading Lyon’s book, “Disrupted,” about his own adventure with a digital marketing startup after he lost his job at Newsweek.