Computer programming once had much better gender balance than it does today. What went wrong?

Current senior here who has interned in software engineering roles, is becoming a SDE full-time after graduation, and has many close friends and family in the industry at various career levels.

Widespread misogyny is prominent and sexual/gender-based harassment are real issues and pervasive in software engineering. I have seen it everywhere I have worked (internships, part-time work), and have yet to come across an organization of more than 15 people where it is not a serious issue. It is also present in our classes (at Michigan, course-wide emails have been sent out about males sexually harassing females during CS office hours)… Sometimes the misogyny comes from professors themselves. I remember a professor completing shutting down and belittling a woman asking a completely valid question in one of my intro CS classes. This was a lecture hall with probably 200-300 students. Women are socialized out of CS, and that is a fact backed up by empirical research data and from what I have seen first-hand.

There is A LOT of work to be done towards realizing equity in the two industries have I had significant junior-level exposure to (finance and technology).