SAN FRANCISCO -- Silicon Valley companies portray themselves as inventors of the future, but they're afflicted by a longstanding problem.

From board rooms to "brogrammers," men still dominate many corners of the tech industry, where the pantheon of famous founders – from Hewlett and Packard to Jobs to Zuckerberg – is still a boys' bastion.

The gender-imbalance issue came to the forefront again recently when a partner at the country's most prominent venture capital firm filed a sexual harassment lawsuit alleging a former colleague retaliated against her for years after she cut off a brief relationship with him. The firm, Kleiner Perkins Caufield & Byers, has denied the allegations.

Whatever the merits of the claim, the suit again has put a spotlight on the tech industry's gender gap.

To Jocelyn Goldfein, a director of engineering at Facebook, the math is stark.

Less than 20 percent of the bachelor's degrees in computer science go to women, according to federal statistics. By comparison, nearly 60 percent of all bachelor's degrees are awarded to graduating females.

The company wants to hire top engineers, but the talent pool in the U.S. is growing thin, she said. Goldfein said she doesn't look to hire female engineers specifically, just the best people. But she said she'd have a lot more to choose from if women entered computer science at a rate anywhere near the average for all fields.

She blames the lack of role models both in popular culture and in day-to-day life as a key reason for the disparity.

"The reason there aren't more women computer scientists is because there aren't more women computer scientists," she said.

Women in other professions such as medicine and law have become fixtures on television and in movies in recent decades, while portrayals of programmers still tend to follow the hacker stereotype of the lone guy sitting in his basement, she said.

Unless their parents are engineers, girls also aren't likely to encounter coders in their own lives the same way they would, for example, a doctor or a teacher.

"We don't really have that same kind of interaction with software engineers as we go about our daily lives," Goldfein said.

Facebook itself has come under criticism over the lack of diversity on its board of directors, which is composed of seven white men, though the majority of its users are women. At the same time, the company's chief operating officer, former U.S. Treasury Department official Sheryl Sandberg, has become the most prominent female executive in Silicon Valley.

Goldfein said women engineers are also behind many of Facebook's signature features, including the news feed and the photo viewer. She hopes the site itself can serve as a tool to draw more girls and young women into computer science.

"If they realize that when I click on a photo and it pops up, that was made by a woman, think how powerful that would be," Goldfein said.

At gatherings across Silicon Valley, especially those where engineers cluster, lines extend far out the men's room door, while the ladies' room has little wait.

"Sometimes it can be hard," said Serena Yeung, 23, a recent Stanford graduate who worked as a software engineer at a Silicon Valley startup before returning for graduate school. Just walking into the classroom is one of the biggest hurdles for women thinking of entering the field, she said. "You go in and you're the only girl in it."

For Yeung, having parents who were both engineers spared her the sense that computers weren't for girls.

She got her first job as a programmer at Mountain View-based Rockmelt Inc., which makes a Web browser with built-in social media features. She started working there even before she graduated with her degree in electrical engineering, another coding-intensive field where men heavily outnumber women.

Rockmelt CEO Eric Vishria says the competition to hire qualified women software engineers has heated up as companies see that they need diverse perspectives to build products that attract the widest audience. He said startups that don't hire women early in their existence risk creating a male-dominated culture that will put off potential female hires.

"It becomes a death spiral, it becomes self-fulfilling," Vishria said. "You have 15 guys in a room, that's your company, and it becomes harder and harder to hire your first woman."

Yeung said a recent experience at a Stanford Society of Women Engineers event for elementary school students showed her that intervention needs to come early to steer girls toward tech. She said girls who had just come from a computer science workshop complained they didn't like it because the boys asked all the questions.

Steeped in video game culture and barraged by positive male tech industry role models, boys tend to dominate conversations around computing early on, leaving girls feeling shut out, said Yeung.

As for her own childhood, Yeung said that as she got older, her commitment to computing carried a social cost as female friends drifted toward other interests.

"It's harder to spend time with them. It's harder to do things with them," she said. "I think you feel kind of a conflicting pull between friends and career interests. That can be hard."

Also on HuffPost:

Check out the most influential women in tech, according to influence-rater PeekYou.
Loading Slideshow...
  • #9: Ellen Kullman, CEO Of DuPont

    PeekScore: 7.32 / 10.00 <a href="http://www.peekyou.com/ellen_kullman/78658725" target="_hplink">Ellen Kullman</a> began her <a href="http://www2.dupont.com/Our_Company/en_US/executives/kullman.html" target="_hplink">career at DuPont</a> about 24 years ago, working her way from marketing manager up through the ranks of executive vice president to president to her current position as CEO and chair of the board, which she began on January 1, 2009.

  • #8: Virginia Rometty, CEO And President Of IBM

    PeekScore: 7.60 / 10.00 <a href="http://www.peekyou.com/ginni_rometty/333679852" target="_hplink">Virginia "Ginni" Rometty</a> was appointed to her current positions as president and CEO of IBM <a href="http://www-03.ibm.com/press/us/en/biography/10069.wss" target="_hplink">just this past year</a>, on January 1. One of her biggest accomplishments over the course of her 31-year career at IBM was the acquisition she led of consulting firm PricewaterhouseCoopers Consulting <a href="http://www.nytimes.com/2011/10/26/technology/ibm-names-a-new-chief.html?pagewanted=all" target="_hplink">for $3.5 billion</a>.

  • #7: Cher Wang, Co-founder And Chairperson Of HTC

    PeekScore: 7.68 / 10.00 In addition to co-founding HTC Corp., <a href="http://www.peekyou.com/cher_wang/167494999" target="_hplink">Cher Wang</a> founded the computer processor supplier VIA Technologies, Inc. <a href="http://www.htc.com/www/about/#leadership" target="_hplink">in 1987</a>. Last October, <a href="http://www.forbes.com/sites/ericsavitz/2011/10/26/cher-wang-the-most-powerful-woman-in-wireless-takes-on-apple/" target="_hplink">Forbes named Wang</a> "The Most Powerful Woman In Wireless."

  • #6: Safra Catz, President Of Oracle

    PeekScore: 7.80 / 10.00 <a href="http://www.peekyou.com/safra_catz/51174974" target="_hplink">Safra Catz</a> assumed the role of president of hardware and software company Oracle <a href="http://www.oracle.com/us/corporate/press/BoardofDirectors/016342.htm" target="_hplink">in January 2004</a>. <a href="http://money.cnn.com/galleries/2011/fortune/1109/gallery.highest_paid_women.fortune/index.html" target="_hplink">According to CNNMoney</a>, Catz is the highest paid woman in business, with total earnings of $42,095,887 in 2010.

  • #5: Ursula Burns, CEO Of Xerox

    PeekScore: 7.89 / 10.00 <a href="http://www.peekyou.com/ursula_burns/57999322" target="_hplink">Ursula Burns</a> joined Xerox <a href="http://news.xerox.com/pr/xerox/ursula-m-burns.aspx" target="_hplink">more than 30 years ago</a> as a mechanical engineering summer intern and has held her position as CEO since July 2009. Shortly after becoming CEO, she led the <a href="http://online.wsj.com/article/SB125413413514545919.html" target="_hplink">$6.4 billion purchase</a> of Affiliated Computer Services, <a href="http://news.xerox.com/pr/xerox/ursula-m-burns.aspx" target="_hplink">the largest acquisition in Xerox history</a>.

  • #4: Susan Wojcicki, SVP Of Advertising At Google

    PeekScore: 8.00 / 10.00 <a href="http://www.peekyou.com/susan_wojcicki/76320003" target="_hplink">Susan Wojcicki's</a> run with Google started even before Google began. Back in 1998, Wojcicki rented out her garage -- the tech giant's birthplace -- to its co-founders, Larry Page and Sergey Brin, <a href="http://www.usatoday.com/tech/techinvestor/corporatenews/2007-07-04-google-wojcicki_N.htm" target="_hplink">for $1,700 a month</a>. After Google got on its feet, Wojcicki served as <a href="http://www.crunchbase.com/person/susan-wojcicki" target="_hplink">its first marketing professional</a>, eventually reaching her current position as senior vice president of advertising <a href="http://bits.blogs.nytimes.com/2010/10/25/google-promotes-susan-wojcicki-advertising-executive/" target="_hplink">in October 2010</a>.

  • #3: Marissa Mayer, VP Of Location And Local Services At Google

    PeekScore: 8.22 / 10.00 At just 37 years old, <a href="http://www.peekyou.com/marissa_mayer/3429432" target="_hplink">Marissa Mayer</a> is the <a href="http://www.crunchbase.com/person/marissa-mayer" target="_hplink">youngest member</a> of Google's executive operating committee. The talented exec joined the Google team fresh out of Stanford <a href="http://www.huffingtonpost.com/2011/07/06/google-marissa-mayer-women-in-tech_n_891167.html" target="_hplink">back in 1999</a>.

  • #2: Sheryl Sandberg, COO Of Facebook

    PeekScore: 8.34 / 10.00 <a href="http://www.peekyou.com/sheryl_sandberg/365002232" target="_hplink">Sheryl Sandberg</a> also has some ties to Google -- she used to serve as the company's vice president of global online sales and operations. Nowadays, Sandberg is one of the most powerful women in tech as Facebook's COO, a position she <a href="http://allthingsd.com/20080304/sheryl-sandberg-will-become-coo-of-facebook/" target="_hplink">snagged in March 2008</a>.

  • #1: Meg Whitman, President And CEO Of Hewlett Packard

    PeekScore: 8.98 / 10.00 Since becoming HP's new president and CEO b<a href="http://www.huffingtonpost.com/2011/09/22/meg-whitman-hp-ceo_n_976597.html" target="_hplink">ack in September 2009</a>, <a href="http://www.peekyou.com/meg_whitman/50531455" target="_hplink">Meg Whitman</a> has made some bold moves -- most recently, <a href="http://www.huffingtonpost.com/2012/03/20/hp-pc-printer_n_1367656.html" target="_hplink">Reuters revealed</a> her plans to combine the company's PC and printing divisions in order to streamline sales. While it's <a href="http://www.latimes.com/business/la-fi-meg-whitman-20120405,0,4066578.story" target="_hplink">still yet to be seen</a> whether Whitman can turn HP around, she certainly <a href="http://www8.hp.com/us/en/company-information/executive-team/meg-whitman.html" target="_hplink">has enough experience to help her out</a>: Prior to her current position, she served as president and CEO of eBay for 10 years, from 1998 to March 2008.

  • ALSO ON THE HUFFINGTON POST

    Sheryl Sandberg discusses marriage, her role as CEO of Facebook, and her high hopes for the future of women today.