When my parents came to the U.S. in 1973 as refugees from Uganda's brutal dictator Idi Amin, we were one of the only South Asian families on my block in the suburbs of Chicago. As I grew up, my father wished for me to become one of three things: a doctor, a lawyer or an engineer like he was. To him, these were the jobs with the highest earning potential—jobs that could help our family rise up into the middle class. This was his idea of the “American dream.”

In 2002 I got my law degree from Yale University and eventually found work as a lawyer on Wall Street. But after years of dealing with securities fraud cases and asset management, I was ready for a change. So in 2010, at the age of 34, I quit my prestigious, high-paying job to run for Congress in New York City. While campaigning, I would visit hundreds of classrooms across the district I hoped to represent. That district included some of the wealthiest and some of the poorest zip codes in the city, and in a single day I would visit schools with little to no access to computers, as well as ones with sophisticated computer labs and boys—almost always boys—clamoring along a new path to the American dream. In search of job security and prosperity, they were not studying to be doctors, or lawyers, or mechanical engineers—they were learning to code. Each time I walked out of one of these privileged classrooms, I would ask myself, “Where are the girls?”

Although I ultimately lost the congressional race, this tech gender gap had become my obsession, and I decided to pour all of my energy into solving it. After about a year of careful research, in the summer of 2012 several collaborators and I gathered 20 girls from all across New York City and for seven weeks taught them how to program. We called the project Girls Who Code. None of the girls had a background in computer science, but they all possessed a willingness and the bravery to try something new. During those seven weeks, I saw something magical unfold. I saw girls who began as strangers call one another sisters. I saw girls who thought coding was only for boys gain new role models who looked like them. And I saw girls who never thought they would be interested in the subject work together to build apps and Web sites addressing the issues that were closest to their hearts.

Participants in a Girls Who Code Summer Immersion program learn and practice the basics of computer science. Credit: Jessica Scranton

I did not know it at the time, but that first experimental Girls Who Code program was the seed of what today has become a national movement not only to teach girls computer science but also to foster a sense of sisterhood among them and introduce them to mentors in industry and academia. Five years later Girls Who Code's Summer Immersion and year-round Clubs programs have taught about 40,000 girls ages 13 to 17 all across the U.S.—that is four times the number of girls who graduated with a degree in computer science in 2016. We have engaged thousands of volunteers and instructors in every state in the country, and this year we are launching a book series for girls to learn to code. We believe that bringing more women into the innovation economy of today and tomorrow is a critical step toward increased economic growth and opportunity.

The key to our success has been knowing where the gender gap in computing begins. It does not start when a woman lands her first job or even when she goes off to college—it starts in middle school. Poor media portrayals and a lack of role models are largely to blame. In 1984 37 percent of computer science majors were women. Today that number is just 18 percent. It is no coincidence that in the 1980s personal computers were marketed heavily to boys—something that vastly changed public perceptions of what a computer scientist did and looked like. What began as an industry filled with women morphed into one where coders were nerdy guys working in a basement. Girls got the message and opted out in droves.

Despite our remarkable successes over the past five years, the tech gender gap is still poised to grow. Last year we released a research report with the business and technology consultation company Accenture entitled Cracking the Gender Code, a study that looked at the shifting factors influencing girls' pursuit of computer science at every stage of their education. The report found that women's share of the U.S. computing workforce could decline from 24 to 22 percent if more is not done to tackle the gender gap. To date, most of the private-sector funding for early computer science education has gone toward providing universal access to computers and other educational tools rather than focusing specifically on young women. If we want to reduce and close the gender gap, we need to target girls and design interventions specifically for them.

Meanwhile the demand for computing skills continues to far outstrip supply, plaguing U.S. employers with a talent shortage. In 2015 there were more than 500,000 open computing jobs to be filled in the U.S. but fewer than 40,000 new computer science graduates to fill them. The demand for information technology jobs is likely to grow in the near future, probably at rates faster than most other occupations, which mainly now offer lower average salaries nationwide. The untapped potential of women to fill the IT jobs of today and tomorrow has vast implications for U.S. competitiveness.

The current landscape may look bleak, but this issue is solvable. To reverse the declining trend, we need to invest in initiatives that are specifically tailored to sparking and sustaining girls' interest in the field from middle school onward through high school and into college. We cannot continue to take our eyes off gender. Today's middle school girls have the potential to fill 1.6 million extra computing positions by 2025—twice the potential of high school and college girls combined. Reaching that potential requires not only teaching girls to code but also teaching their instructors and their parents to portray programming as a cool, fun way for them to reach aspirations—not just a pursuit for boys. Access to a computer science education is a viable path to the American dream we all strive for and to the economic security and prosperity we wish for all our daughters. It is the same wish my father had for me.