Marissa Mayer, the new head of Yahoo, is not the first woman to become CEO of a high-profile technology company. The sharp-witted Carol Bartz briefly held that post at Yahoo. Meg Whitman presided over eBay for a decade and now runs Hewlett-Packard, a company that once had Carly Fiorina at the helm. The "grande dame" of American computer giants, IBM, currently has Virginia Rometty running the show.

Still, women in the top jobs at tech companies remain rare. Mayer, Bartz and Rometty are especially unusual; they are computer scientists. Despite the growing numbers of successful women in once male-dominated professions like medicine and law, computer science remains overwhelmingly a boys club. In fact, over the past 25 years it has gotten worse.

In the 1980s women made up nearly 40 percent of computer science majors, according to the Anita Borg Institute for Women and Technology. In 2008, that number was down to 18 percent. Stanford University, Mayer's alma mater, with one of the world's most prestigious computer science programs, looks even worse; last year 11 percent of its graduates were women — down from 16 percent in 2001.

At a time when computers are expanding into every aspect of our lives, from the workplace to the home and even into romance, the people shaping how they work and what they do are predominantly of one gender. The reasons why the male geek is ascendant are complex.

In an interview I did with Mayer at the Computer History Museum earlier this year, she reflected on her time as a computer science major at Stanford with a story that helps explain a little bit about why she has defied the odds. Mayer is a typical geek. She admitted she can be a little "oblivious."

Mayer recalled that while she was at Stanford, a columnist for the campus newspaper wrote an article about "campus icons. These were people who everyone knew and would recognize by description but you probably didn't know their name ... like the person at the coffee house who never managed to get your sandwich order right," Mayer said.

She read through the column laughing and came upon this description: "The blond woman in the upper level computer science classes." Mayer, who is blond, read that line and thought to herself, "Gosh! I should know who this is." It took her a while to realize that was a description of her. She says she never really noticed "I was the only woman."

But Mayer may be unusual. Jocelyn Goldfein, Facebook's director of engineering, describes how a lot of women feel when they walk into a computer science class. "I don't know if you've ever had the experience of walking into the men's room by accident," she said, "and you sort of have this full body shock of, 'Oh no! I'm not where I'm supposed to be.' "

While there are certainly women who have gotten ahead in the tech sector without that background, like Whitman and Fiorina, having technical knowledge makes a big difference. Bill Reichert, a partner in the venture capital firm Garage Technologies, says when he looks for a startup to fund, "We tend to invest in companies that have very strong core technical teams, and ... that population is disproportionately male."

And it is that pool of entrepreneurs that succeed with a startup who are often the ones who end up running the companies. Indeed, Mayer was Google's 20th hire and is responsible for the look and feel of many of Google's major products — the simplicity of its home page, Gmail and Google News.

Her background has a lot to do with what makes her an appealing CEO for Yahoo, a company that hasn't been on the cutting edge of technology for over a decade.

There are efforts to try to draw more women into computer science. One of the most successful programs is at Harvey Mudd College in Claremont, Calif. Although the school is for students who want to specialize in engineering, science and math, when Maria Klawe became its president five years ago only 10 percent of its female students chose computer science as a major.

Klawe, who is a computer scientist, evaluated her programs and made some changes. Part of the problem, she says, was that there would be a few male students in every class who already knew how to program and wanted to show off. "They desperately want to show the professor how much they know," says Klawe, "and it's very intimidating to other students, especially women."

Klawe changed the curriculum. She created different-level introductory classes and instead of teaching them in the programming language Java, she switched to Python, which is more user-friendly and makes it possible to do actual programs more quickly.

Also crucial to her change was sending any first-year female student to the Grace Hopper Celebration — named after a renowned female computer scientist who died in 1992. The event draws women in the field, both young and old, to a different city every year. Klawe says this gives the students the opportunity to see that there are successful women in the field.

The result of Klawe's changes at Harvey Mudd is that last year 40 percent of the computer science majors at the school were women. Clearly, having role models makes a difference.

That may be why Mayer's ascendance to the top of one of the most well-known tech firms has meaning for women. She has the potential to be an inspiration.

However, Mayer takes the helm of a struggling company. In the end, her gender will have little to do with Yahoo's prospects. Her experience as a top-notch computer scientist who understands what makes a successful user experience online is what matters most. But if she does succeed she may help light the way for a new generation of female computer scientists.

Copyright 2012 National Public Radio. To see more, visit http://www.npr.org/.