There's been lots of talk over the past few years about the glaring lack of diversity in Silicon Valley's tech industry. Software engineer Leslie Miley made national news this week when he publicly explained his recent decision to leave his job at Twitter — a job he loved — citing frustration over the company's overwhelmingly white workforce and internal resistance to changing it.

Miley was part of a wave of layoffs at Twitter last month, but as TechCrunch reports, he had informed the company of his intention to leave before the layoffs. He also says he declined a severance package so that he could speak publicly about why he left.

This week, he did just that in an essay at Medium. Since his departure, Miley writes, "Twitter no longer has any managers, directors, or VP's of color in engineering or product management." Meanwhile, 27 percent of black adults online use Twitter, compared to 21 percent of white adults, and the rise of Black Twitter has undoubtedly been integral to the company's growth.

Miley says he tried to move the needle — lobbying for diverse candidates at "contentious" hiring meetings, pitching a new Diversity Engineering Manager position — but ultimately gave up. "For some at Twitter, diversity is an obstruction to avoid," he writes.

I talked to Miley on Thursday about diversity in the tech world, the barriers and the possibilities, and where Twitter does — and doesn't — get its employees. We reached out to Twitter for comment; its response is at the bottom of this post.

Silicon Valley is looked at as one of the places most intransigent to the idea of, let alone the execution of, diversity. What's behind that?

It's a question that maybe should be asked of the people who resist it, and really try to elicit a frank and honest response from them. People in tech so want to believe in a meritocracy. They fundamentally want to believe it's about how good you are, how smart you are, how hard you work. Yeah, I'd like to believe that, too, but the fact of the matter is, when you don't give everybody the opportunity to work that hard, when you don't give everybody a fair opportunity to get through the door, it is not a meritocracy. And the moment you say "diversity," I think a lot of people think you're calling them racist or a bigot. They automatically go on the defensive, or they just don't want to have the conversation.

You say you had a boss who was resistant to diversity because he believed he'd have to lower the bar to get more diverse candidates, and he wasn't willing to do that. [The executive, Alex Roetter, disputes Miley's account, but in a statement concedes he "did a poor job communicating" on the issue of diversity.]

When somebody brings up the diversity-and-bar thing, I have to say "No, by the time somebody is in front of you, they've already exceeded your bar." Once people hear that, I think they start to understand it. But how often are they going to hear that if they don't have people of color around them in enough numbers to have those casual conversations?

This past summer, I had a group with more African-descended people than I'd ever worked with. Like, nine people, a mixture of employees and interns. People would ask how that happened, and I'd say "Because we made it happen."

So how'd you make it happen? Is it recruiting, is it hiring, is it promoting — is it all those things?

Well, let's look at recruiting, because that's a good place to start. At a lot of the tech companies, I'd say maybe 40 percent of new hires from most of the tech companies and most of the unicorns [startups whose value exceeded a billion dollars] probably come from university recruiting or new grads.

The recruiters know what the hiring managers and the directors want to see: CMU [Carnegie Mellon University] grads, Cal grads, Stanford grads. They understand that those people have the highest likelihood of being phone-screened, of being interviewed, and of getting the job. So that's who they're going to over-index on.

There's a document at Twitter that lists the schools that Twitter wants to recruit from. This document was penned by Alex Roetter, the Senior VP of engineering. He had his other directors contribute to it, modify it and refine it. It listed Cal, Stanford, CMU, Waterloo, MIT, typical schools like that. Never listed any state schools. Never listed any HBCUs. It listed certain companies and excluded certain companies. It excluded certain titles. So if you're a software engineer in tests [an engineering role] at Microsoft, that's not a "real" software engineer. And some of the best engineers I know are software engineers who test for Microsoft!

Sometimes Twitter will display a popular hashtag on a wall at Twitter HQ — in one photo you can see #BlackLivesMatter. Does that mean you all were having discussions about, say, Ferguson when Ferguson was actually happening?

We put things on the wall when they're trending, but it wasn't like "Hey, do we know that we're actually enabling the next civil rights movement?" Up until [former CEO] Jack Dorsey returned, that was never spoken — at least not that I can remember — at the company. We might talk among ourselves about it, but the cognitive dissonance was hard for any person of color, or anyone who was devoted to diversity at Twitter, to deal with: How can we do this as a platform, and be so bad at it inside these walls? It's hypocrisy.

At one point I tried to figure out how much of Twitter's U.S. revenue we can attribute to people of color and women. And it is not an insignificant amount. If that cohort goes away, Twitter pretty much doesn't survive.

So does management see it that way?

Jack does. He's actually said: "These are our users. And we have a responsibility to reflect those users inside this company." Change comes from the top. It's just going to take so long: you just don't say it and make it happen. It's like the civil rights bill: you can change the law, but people are still going to have their opinions. Just like it took George Wallace time to come to his senses — several decades, right? — but he did.

And yes, the cycle is a lot faster now, but it's still taking people time to internalize that.

So you've left Twitter and it's been fairly public. You posted about Twitter's need for more diversity and inclusion. What's the reaction been?

Overwhelmingly positive. There are going to be haters and trolls out there, but what's more impactful for me is the support of people inside of Twitter, and they're actually supportive publicly, via retweeting, via favoriting, via mentioning, on Twitter! Those are the best co-workers I've ever had.

We should point out that you and I are having this conversation because you didn't take Twitter's severance package, which would have required that you not talk about things like this. So you left a good deal of money on the table. Any regrets?

You know, I wish I didn't have to leave. It's rare in your career to have a job that really intersects your personal and your private lives. And it allowed me to impact things that I really care about, and things that actually impact my family. So the regret is I don't get to do that anymore at Twitter.

Can you talk about future plans?

I know what I'm going to be doing, but can't talk about it just yet. It's going to have diversity at its core, and it's going to be in engineering. So I'm going to get to do my passion for both those things.

SeparatorCode Switch reached out to Twitter for comment on Miley's remarks on Twitter's struggles with diversity, and his claim that Twitter hires from a predetermined list of colleges and universities. Here's what spokesperson Natalie Miyake told us:

"We're committed to making substantive progress in making Twitter more diverse and inclusive. This commitment includes the expansion of our inclusion and diversity programs, diversity recruiting, employee development, and resource group-led initiatives. Beyond just disclosing our workforce representation statistics, we have also publicly disclosed our representation goals for women and underrepresented minorities for 2016, making us the largest tech company to put hard numbers around its diversity commitment."

Miyake also pointed us to a response posted publicly by Alex Roetter, SVP of Engineering at Twitter, whom Miley was critical of in his own essay.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.