From left, Kumail Nanjiani, Thomas Middleditch, Zach Woods and Martin Starr in “Silicon Valley.” (John P. Johnson/HBO)

This post discusses “Hooli-Con,” the June 18 episode of “Silicon Valley,” in detail.

This may sound like a funny thing to admit at this point in “Silicon Valley’s” run, but until this episode, I’m not sure I’d ever thought very deeply about whether Richard Hendricks (Thomas Middleditch) is a good person. I know that he’s a genius and that the show has convinced me that the hurdles to bringing a truly revolutionary technology to market in Silicon Valley are enough to drive a decent person around the bend. I know that I find his enthusiasm and commitment to something more than a quick payday more admirable than Erlich Bachman’s (T.J. Miller) parasitic bloviating, Gavin Belson’s (Matt Ross) paranoiac messiah complex or Jack Barker’s (Stephen Tobolowsky) dull cunning. I know his fumbling and anxiety are endearing. But given that the events of “Silicon Valley” were kicked off in part by Richard’s desire to be a different person than Gavin and to found a different kind of company than Hooli, I’m actually a little surprised at myself that I haven’t pondered Richard’s moral fiber.

“Hooli-Con” provides many opportunities to do that. And I think the conclusion it ultimately suggests is that Richard isn’t an actively malevolent person, but that he is a weak and impulsive one and more prone to give in to his worst impulses when he feels under stress.

“It’s all for the greater good!” Richard tells Jared (Zach Woods) as he hatches his plan to hijack Hooli-Con’s WiFi and sneak the Pied Piper app onto attendees’ phones so that the company can take a step toward its vision of a new Internet without having to follow the normal process of signing up actual users. “It’s a mean to an end. It’s not who I am.” “We’ll be rewarded in the end.” “We were in crisis mode.”

If Richard has allowed his business woes to convince him that a compromised plan is worthwhile, his personal foibles are even more painful to watch. It was awful to see Richard fall into bed with Dan Melcher’s (Jake Broder) fiancee a few episodes ago, and it’s worse to see him give in to the instinct to play an incredibly dumb prank on the boyfriend of a woman to whom Richard could barely even claim any emotional attachment.

Jared spoke for me, and I suspect for many of you, when he demanded “Can you do me a favor, Richard, so I know I’m not hallucinating … Look me in the eyes and you name our undoing!”

Of all the things Richard has done on the show, the worst is his corruption of Jared, someone who quit a promising but morally compromised job and endured diminished living circumstances in the quest to work on a true innovation as part of a decent company. The series has mined incredibly funny jokes from Jared’s asides about what sounds like a horrifying childhood, including this week, his objection to the Hooli-Con scheme on the grounds that “As a product of forced adoption, I can assure you there are consequences!” But all these jokes add up to a sobering point: Jared has worked much harder than anyone on the show to build a decent life for himself, and Richard has effectively joined the list of his abusers and exploiters.

“Hooli-Con” punctuates that point sharply with a plot twist that slyly upends Erlich’s declaration that guys like him and Richard are cursed by fate.

Just when it seems as though the Pied Piper team is going to get kicked out of Hooli-Con or worse after the discovery of their Pineapples, Hooli security chief Hoover (Chris Williams) lets them go, both because he admires the way Richard has treated Gavin and because he wants to see Jack Barker humiliated and fired. The lesson Richard takes from it is that he’s a decent person at his core and that his best impulses have paid off. But it’s also a stroke of extraordinary luck that the head of security at Hooli is someone who is loyal to Gavin and wants to see him redeemed, just as Richard is extremely lucky that Dan’s fiancee didn’t leave him after Richard slept with her. These storylines don’t reverse the overall dynamic of “Silicon Valley,” but they are a timely reminder that Richard is more fortunate than he generally likes to admit and that his personal missteps could have sunk Pied Piper just as easily as the overall cynicism of the valley.

It’s fitting for a comedy that Richard isn’t a monster, or even a Keenan Feldspar-like (Haley Joel Osment) titan of oblivious entitlement. He isn’t a good person, though, and even without the malign influence of Hooli, he has done bad things with real consequences.