The social aspects are subtle, and more important than most of the official stuff.

In seventh grade a great (male) teacher of mine recommended a summer program for me, at the dawn of the internet (Gopher!). I joined the math & computer class and was the only girl. None of the boys would talk to me at all. At lunch every day they ditched me and I went to find some kids from the theater class to sit with. Is it malicious? No; it's seventh-grade boys. Is it encouraging? No. I was lonely six hours a day because no one would speak to me.

In my engineering college, it was the dating thing. From being a nerd who was ignored in high school, not exactly prime dating material, I was suddenly transformed into a 'female'. I got asked out constantly. Sounds great, right? But if your classmates only want to have sex with you, and don't want to do homework with you, you're cut off from much of the joy of intellectual discovery of college. I was ignored by the profs and couldn't do a senior project, even though it was in the catalogue, because no prof would sponsor me. When I waitressed, the guys would first flirt with me and then upon discovering I was an undergrad in a tough major they'd turn very serious and gush about how important it was for women to be involved in that field, how special I was. Is it evil? No. It's like being a stay-at-home dad at the park with your kids in the middle of the day. Alienating. (My husband reports he hasn't made it past the none-of-the-moms-talking-to-him phase when he's made his forays.)

From college into grad school the emphasis on me as a potential romantic partner didn't stop. I remember joining the Linux Users Group in the town I went to grad school in. Some great guys, some good parties & good times. All juxtaposed with, for instance, the guy who I thought invited me over to talk about compilers... but when I showed up, candles were lit and the dinner table set for two. Is that evil? Is that an active discouragement from the field? It's just deflating. I thought I'd found someone I could talk to. He didn't want to talk to me after I'd declined to get involved.

I wore baggier and baggier clothes and never figured out how to do makeup or hair (now holding me back in corporate America) but simply trying to disappear into sweatshirts did not enable me to be 'one of the guys'.

In one research center I was involved with in grad school, it was more textbook-style discrimination. The women did all the work and wrote the grants that got the money. How can I say that? Surely it's unfair! But it is true, because everyone in the research group besides the director and one guy was female -- there was literally no one else. The director was phasing into retirement and was trying to groom the guy employee -- taking him to golf on Saturdays, taking guy to drink South African wine with director and director's wife. The problem was that guy employee wasn't very good, and once director retired, guy couldn't do the work and wasn't able to keep that position or the next two. The women found varied levels of success and failure elsewhere, but didn't get the chance at leadership at that center!

Later in grad school and into my postdocs, it was the constant assumption that I was primarily interested in education, not research. Put into a job code where I actually couldn't get funding from the research grants I won, asked last year to contribute to the education components of three guys' research grants to boost their 'broader impacts' score. Not everyone did this -- one colleague actually talked with me about research, and it was really nice.

When I was a prof, one or two (male) students tried to physically intimidate me into giving a higher grade. That's 1, 2 out of thousands... but an experience that my male colleagues did not have. I taught a lot of extra independent studies because people felt 'comfortable' with me; my super-friendly and wonderful and cuddly male colleague didn't experience that. I had to serve on the diversity committee and run a diversity event: I did not want to, but it was strongly implied that my promotion was linked to this service. (Right: I'd forgotten I was 'voluntold' for this by a senior male colleague who then didn't mention my name in the acknowledgements and took all the credit at the opening, because he's a "champion for diversity".) Students also came to me with personal concerns a lot, like roommate problems, family being evicted, needing to schedule an abortion, money trouble. I asked my male colleagues what they did about this and they said they'd never been asked about any of these things! Were these kids in college actively discouraging me from a STEM career? No way in hell! They were lovely young people! But the extra burden of teaching additional independent studies, running this stupid diversity event, and providing tissues to students in real trouble took time away from writing up research, and that's how you get promoted.

I couldn't win the battle with being tracked more and more into education rather than the research I love and left academia for industry this year. Hooray! Now I'm paid more and I 'program all day', and get to do the experimental CS/math/stats I enjoy. Am I a success story or not? I'm the example of the 'leaky pipeline' in academia.

Several replies to my previous comment said things like 'literally no one has said that' there's a conflict between me being female and liking STEM. But from this thread alone:

"I'm my experience women tend to be more interested in human facing parts of software like web and ui development, but less interested in the back end parts." "What if women were calling those environments toxic because they had a hard time doing well in there?" "I don't understand why modern society doesn't understand/want to believe that men and women have different career interests than men. Men and women value things differently, and it's not all because of society." "Ask women and you'll find that most aren't interested in programming a computer all day. Which one could argue is a sane choice. If anything it's more sane. Stop trying to make them feel like something is wrong if they don't have this inclination. Males and females have different preferences on average, some as early as birth[1]." Are any of these commenters actively discouraging me from pursuing my STEM career? No. They're just repeating the message again and again and again that women just like different things. Yeah, I do like different things. But it's always code for "you're not normal". And it's true that I'm statistically not in the majority. Folks, I know that. You don't have to tell me every day. I've been able to calculate percentages for thirty years. I've known I'm outnumbered for thirty years. I'm always aware that I'm a minority. Always. And that's what is tiring. It's not discouraging -- it's the surprise that I exist, then either the turning to talk to someone else or the gush of fake or real 'encouragement' that I'm so brave to be so different.