Apple, Google, Microsoft and the race to look diverse

Google io techmakers
Members of Google's Women Techmakers group pose at the company's I/O developers conference in May.

A favorite joke of women at tech conferences is to tweet a photo of the bathrooms. A long line of guys in hoodies snakes down the hall outside the men's room. Nobody waits for the women's room.

Microsoft, Google and Apple are trying to makes those lines a little longer.

Every year, the tech giants host high-profile developers conferences like WWDC and Google I/O where thousands of people gather to learn technical skills and network. The events are known for their flashy launches of new technology -- and for being overwhelmingly male, white and Asian.

Nowhere is the lack of women in technology, especially in leadership roles, more glaring than in the keynote addresses put on by the same companies.

Microsoft (MSFT) was the first to change that image. At its Build keynote in April, three women -- Agnieszka Girling, Briana Roberts and Lara Rubbelke -- gave presentations. At I/O in May, Google (GOOG) also included three female employees in the keynote: Aparna Chennapragada, Jen Fitzpatrick and Ellie Powers.

Related: Apple updates iPhone and Mac software

On Monday morning, Apple (AAPL) was still one woman short of its competitors (unless you count Siri).

In its WWDC keynote, Apple had two women: Vice President of Apple Pay Jennifer Bailey and Vice President of Product Marketing Susan Prescott.

"Having female engineers and innovators on stage is really important. Not just so women in the audience can see that, but so it normalizes women being technical for everybody," said Ruthe Farmer from the National Center for Women & Information Technology (NCWIT).

Google and Apple are also trying to get more women to attend their developer's events.

"I knew there were more women in tech than I was seeing at the conferences," said Natalie Villalobos, Google's women in technology advocate.

Villalobos helped increase the number of female I/O attendees from 16% three years ago to 25% this year. She's in charge of Google's Women Techmakers group, and this year, she pushed to make I/O more welcoming to women by offering mother's rooms, a new code of conduct, and free childcare for all parents.

Related: Apple unveils Apple Music streaming service

Apple gave out 350 scholarships to WWDC (many of them to women). Google funded $20,000 in travel grants for women and offered female developers free tickets and told them to bring a friend. (A ticket to WWDC is $1,600; Google I/O is $900.)

Both companies also partnered with outside STEM organizations like Women Who Code, the Anita Borg Institute, Hackbright Academy and Girl Develop IT. Apple has been collaborating with the NCWIT for more than 10 years.

These public pushes are good PR for these companies, especially as they struggle with their own internal diversity numbers. But it's also a smart investment. Attrition of employees is costly, and research shows having more diversity can lead to more innovation.

"There's a tremendous amount of interest in this space right now, and that is only going to continue to grow because it is a workforce and diversity imperative," said Farmer.

Related: Apple finally opens up, letting you test iOS 9

On the eve of I/O in May, Google hosted dinners for more than 800 women in town for the conference. Attendees shared war stories and wanted more focus on keeping experienced women in tech, not just attracting new ones. Attendees agreed that the problem wasn't overt, but unconscious bias that permeated the industry.

One of the biggest exits of women in tech happens mid-career, when women leave the workforce at twice the rate that men do.

Women leave the industry, they said, because it gets tiring and lonely to deal with on their own. Seeing other women on stage and in the audience at these tech conferences is a solid first step to improving diversity. But when the events are over, many go back to being one of the only women in the room.

CNNMoney Sponsors