Read more from Slate’s special issue on science education and give us your best ideas for raising the next generation of scientists and engineers.

The United States has produced viable female presidential candidates, women athletes who command millions of dollars in endorsements, and the first female Nobel economist. Yet there is still no female equivalent of a Steve Jobs, Bill Gates, or Mark Zuckerberg. Women continue to lag behind men in computer science, where their share of the workforce has actually declined over the past 25 years. Today, women hold 27 percent of all CS jobs, down from 30 percent a decade ago, and account for just 20 percent of undergraduate CS majors, down from 36 percent in 1986.

The tech gap begins at home, where boys get their first computers and video game consoles at a younger age than girls and are more likely to play with toys that build spatial reasoning skills, like Lego. It continues in schools, where female students voice less confidence in math, science, and computing, and it persists in the corporate world. Even among the younger generation of tech companies, including Facebook, Google, and Twitter, fewer than 10 percent of all computer programmers—the field’s core job—are women, according to industry insiders.

The effects of this gender gap reach far beyond whether women are building video games or coding Web apps alongside men (and making technology female-friendly—remember the Siri/abortion flap? Or the more recent dust-up over Asus’ leering tweet?). Over the past 10 years, three times as many jobs have been created in STEM fields—science, technology, engineering, and math—than in non-STEM fields, and STEM workers have been far less likely to experience unemployment. Women who work in STEM also earn more than other female workers: an average of $31.11 an hour, compared with $19.26 for non-STEM women. The wage gap between the genders is also smaller in STEM fields, just 14 percent, compared with the 21 percent difference between men’s and women’s earning powers in the rest of the workforce.

Economists expect those trends to continue over the coming decade. And if American women can’t step up to meet the growing demand, our foreign competitors will. Brazil, India, and Malaysia are among the rising powers that have much more successfully prepared girls to enter computer science.

Sheryl Sandberg, the COO of Facebook, calls the fight to attract girls and young women to high-tech careers “our generation’s major frontier for equal outcomes for women.” And Sandberg has a counterintuitive suggestion for how to close that gap: “Let your daughters play video games. Encourage your daughters to play video games!” she told me in an interview last fall.

Although most parents would do anything to prevent their children from spending all day in front of a screen playing games, childhood gaming and hacking experience has motivated many computer programmers to enter the field, including Sandberg’s boss, Facebook founder Mark Zuckerberg.

The leap toward more advanced computing comes not only from playing games—today, 94 percent of girls are gaming, compared with 99 percent of boys—but in becoming curious about how they work and then beginning to tinker with code in order to modify game results. Boys are still much more likely than girls to explore this type of simple computer programming, and not every young girl who is curious about how computers work has an encouraging parent at home or the hardware she needs.

So what can schools do to encourage girls in this direction? In 2005 the computer science faculty at Harvey Mudd College in Claremont, Calif., decided to launch a major effort to attract first-year women to computer programming courses and keep them there. Professors noticed that men seemed to arrive in even the most rudimentary computer science classes with pre-existing programming knowledge—often acquired informally through online coding forums—that intimidated less experienced students. So they split the introductory course into two sections: one for true neophytes (who are more likely to be female), the other for those who had tinkered with programming in the past.

Harvey Mudd also launched a summer computer science research internship for 10 female rising sophomores annually and began taking dozens of women CS students each year to the Grace Hopper Celebration of Women in Computing, where they get face time with professional mentors from companies like Cisco and IBM.* Since Harvey Mudd launched these initiatives, the CS program has grown from 31 percent to 42 percent female. Companies like Microsoft, Google, Facebook, HP, and Yelp have flooded the campus during recruiting season in a frantic search for female programmers.

K-12 educators, too, know the importance of getting girls hooked on the kind of “computational thinking” that makes programming possible. The Academy for Software Engineering, a public school whose curriculum will be built around computer programming and Web development, will open in New York City this September. Just one-quarter of the incoming freshman class is female, but the school’s founders, who are closely tied to the New York tech community, have ambitious plans for pairing female students with women mentors working in the field, in order to tamp down on attrition, direct girls into meaningful careers, and recruit more female students to the school in future classes.

In Pajara Valley, Calif., south of Santa Cruz, researcher Jill Denner launched a program that teaches low-income Latina girls and boys, in gender-segregated classrooms, to create their own computer games. Laura Reasoner Jones, a computer teacher at McNair Elementary School in Fairfax County, Va., launched the GEMS Club: Girls Excelling in Math and Science. The club is an afterschool program that gets girls busy building rockets, studying strawberry DNA, and programming their own computer games using free Web-based tools such as ALICE, developed at Carnegie Mellon University, and SCRATCH, developed by MIT.

Because recession-era budget cuts have made it difficult for many schools to direct resources to “extras” outside the core curriculum, some of the most successful efforts to direct girls toward computer programming are happening entirely outside of schools, though often in partnership with them. Jasmine Gao, 18, attended New York’s Brooklyn Technical High School, but it wasn’t until she participated in an afterschool program called the Technovation Challenge, hosted at Google’s New York headquarters, that she realized her interest in gaming could translate into a career.

Run by a nonprofit called Iridescent Learning, Technovation teaches teams of low-income girls programming and business skills by asking them to develop a real mobile Web app and then “pitch” it to a team of judges. Jasmine’s team developed “Trending,” an app that shows shoppers fashion trends and directs them to nearby stores or online retailers that carry a specific shoe or skirt. The team won second place in New York City. The winning effort was “HailNYC,” a girl-developed app that allows mobile phone users to communicate their location to taxi drivers.

Jasmine is now studying finance and computer information systems at Baruch College and hopes to someday launch her own tech business. “I had this preconception that it was mostly geeky men who did programming and it was extremely math and science heavy,” Jasmine said. “But it’s actually easy. And the opportunities presented through it are enormous.”

Also in Slate’s special issue on science education: Fred Kaplan explains why another “Sputnik moment” would be impossible. Also, share your ideas for fixing science education in the Hive. This article arises from Future Tense, a joint partnership of Slate, the New America Foundation, and Arizona State University.

Correction, June 7, 2012: This article originally misspelled the last name of Grace Hopper. (Return to the corrected sentence.)