SAN FRANCISCO — The day before Apple kicked off its annual Worldwide Developer Conference (WWDC), the company hosted a special orientation session for the recipients of its WWDC Scholarship Program — with a special surprise guest, CEO Tim Cook.

Historically, Apple has offered WWDC scholarships to middle, high school and college student developers. For 2015, Apple expanded the program to include members of participating STEM organizations. For the first time, older individuals or those who might not traditionally match the "student" moniker had an opportunity to earn a free WWDC pass, get access to a scholarship lounge and spend time hobnobbing with Apple employees.

Those employees included Cook, who surprised the scholarship winners by making an appearance at the orientation session. He looked at apps, talked to the winners and took selfies.

Cook talked exclusively to Mashable, too — about the state of diversity in tech, and what Apple and the industry can do to make it better.

'It's the future of our company'

Watching Cook interact with some of the scholarship winners — including Kiera Cawley, a 12-year old from New York who has been coding since she was 9 — it was clear this was more than just a photo op for him. He talked with the winners about their apps and about their backgrounds, keenly interested in what made them tick.

I sat down with Cook, a relatively reclusive interviewee, and asked why it was important that Apple ramp up its efforts in diversity. His answer was unequivocal: "It's the future of our company."

Cook added: "I view these people that I talk to today as the future generations of the company, and they will either be a part of it directly or a part of the ecosystem.

"And either way — when I think of Apple, I think of the whole community, not just the people that have the Apple badge."

And that future, according to Cook, should be diverse: "I think the most diverse group will produce the best product, I firmly believe that," he says. Even without taking its values into account, Apple is a "better company" by being more diverse.

Apple's first diversity report, released last year, showed that it isn't exactly there yet. The company is 70% male, for one thing. So how can Apple — and the tech industry at large — do a better job with gender equality?

Cook doesn't subscribe to the idea that women just don't want to be involved in tech — calling that argument a "cop-out."

"I think it's our fault — 'our' meaning the whole tech community," he says. "I think in general we haven't done enough to reach out and show young women that it's cool to do it and how much fun it can be."

One way to solve that? More female role models. "I think mostly people look up and see, 'you know, I'm like that person and I see what they can do,'" Cook says. He acknowledges that Apple and the tech industry at large haven't done a good job with having more diverse role models available.

To improve on that, Cook says Apple is now making outreach efforts to junior high, high school and college women. He also says the company is spending a lot more time with historically black colleges.

"Some of this costs money some of it doesn't. Mostly it's a way of thinking. And so if you believe as we believe that diversity leads to better products, and we're all about making products that enrich peoples lives, then you obviously put a ton of energy behind diversity the same way you would put a ton of energy behind anything else that is truly important."

I asked Cook about the lack of women at WWDC keynotes. He smiled. "Look tomorrow," he said. "Look tomorrow and let me know what you think.

"I totally agree with you. You'll see a change tomorrow."

Solving the bigger problems

Initiatives such as Apple's WWDC scholarship program can certainly help bring more diverse individuals into developers conferences. It doesn't solve the more fundamental issues of the dearth of gender or race-based diversity in tech. But Cook thinks it is a significant start.

"I'm convinced we're going to move the dial. It's not an overnight thing, we both know that," Cook says. His diversity report shows that just 7% of Apple employees are African-American, compared to around 13% in the general population.

"But it's also not an unsolvable issue. It's readily solvable. Because most of the issues have been created by humans, so they can be fixed."

Part of fixing the problem involves people like Cook speaking out against the lack of diversity. The CEO says the biggest obstacle to making tech more diverse aren't what he calls "the lunatic fringe people."

"The problem, as Dr. King said, is 'the appalling silence of the good people,'" Cook insists. "I try to look at myself in the mirror and ask myself if I'm doing enough. And if the answer is no, I try to do something more. And sometimes you do things that don't work and sometimes you do things that do work. Somehow we've got to get enough people to believe how important it is, and see how wrong it is not doing it."

For Cook, that means fighting against being silent as well as creating programs to make it better.

"I've been thinking a lot about this," he says. "I've been thinking about how this relates to Apple and things we should do and can do." Speaking out can be hard "because society unfortunately rewards the keep your head down approach ... but doing that won't move anything forward, it's not going to move the country forward, industries forward or companies forward. You don't solve diversity like that."

Educating the masses

Part of Apple's recent $10 million commitment to increasing the number of women in tech has gone to the new Latinas in Tech initiative run by the National Center for Women & Information Technology (NCWIT). Apple has worked with NCWIT for over a decade and is its only Lifetime Partner.

"I have the greatest job in the world," says Ruthe Farmer, Chief Strategy and Growth Officer at NCWIT, who attended the Apple event with Cook. "I get to encourage young girls to get interested in technology."

Farmer, who has been working on increasing female participation in technology and engineering since 2001, says it's important for girls to get exposed to technology early. She believes the ratio of female computer science degree graduates has fallen drastically over the last 30 years because of the social costs, and outside pressures, that tell young women technology isn't for them.

"The bottom line is computer science just isn't available in the schools," she says. "We need to create more earlier exposure opportunities, and I think some of those opportunities might need to be single sex — so that girls can have a chance to play and get to know the tech."

Farmer also thinks that we need to look at the way technology is sold to women. "The thing that the entire discipline of engineering has not done well is make it clear that if you want to do something big and have an impact on a lot of people, technology is the way to do it," she says. "I think that is a more compelling message for many girls, and other students in general."

Through her work with various coding camps, after school programs and other STEM resources, Farmer has seen the good that can come from encouraging young women early. One of the scholarship winners at WWDC, Katilyn Lee, is someone Farmer has been watching for over a decade.

Lee, a rising senior at USC, is working on her own cooking app for iOS. Farmer has clear pride when talking about seeing Lee as a twelve year old at a coding class and now, a decade later, as a young woman about to embark on an engineering internship at Facebook's London office.

To help usher in a new generation of girls like Katilyn, it's essential that there are more programs available for young women to learn how to code. One of those program is App Camp For Girls. App Camp For Girls focuses on helping middle-school aged girls become introduced to programming and coding via iOS. Now in its third year, App Camp For Girls has expanded from its Portland roots into Seattle and Vancouver, Canada.

During the week long camps, girls come up with and built their own apps. For Jean Macdonald, the founder of App Camp For Girls, letting young women know it's possible to build an app, is hugely important.

"It doesn't have to be complex," she says, pointing out that just showing it's possible can often be as important as anything else.

Like NCWIT, App Camp For Girls is one of Apple's STEM partners and has representatives attending WWDC as part of the scholarship program. Macdonald is currently holding an Indiegogo campaign to help App Camp For Girls grow.

Coders from all ages and backgrounds

For Natasha Usher, a former school teacher from Atlanta, app development was something she was drawn to as a way to capture her students's attention. "As a teacher, I constantly had to get my students to put down the iPhone," she says. So rather than fighting against technology, Usher decided to embrace it.

She's built a series of educational apps, including Chalkboard Spelling words and Chalkboard American Presidents, as a way of honing her programming skills, as well as a way to connect with her students.

Usher applied to WWDC's scholarship program through her work with the STEM group Blacks in Technology. She told me that even though she heard about the scholarship from Blacks in Technology, the founder of the group told her there wasn't a large number of applicants.

This was a sentiment you hear a lot from scholarship winners, but Usher hopes that her participation can encourage others. "I want people to know that it is possible," she said. "You don't have to be a young, white male in order to code."

That's a sentiment that Ruben Martinez, a recent graduate of Bowdoin College, shares. Martinez has a number of apps in the App Store, including a Twitter app called Infinitweet.

Martinez started coding by building web apps. He moved into iOS apps a few years ago. In addition to building his own apps, Martinez is moving to New York City to help teach children of color code. Like Usher, he believes that seeing more people that look like you coding can help encourage others to join in. This is his first WWDC; he's looking forward to meeting other developers and interacting with the community.