In no way a defense of the described behavior: one of my pet theories is the coding culture fills a void where monastic culture used to be (now dwindling in the west). Many males are insecure and I’d say secretly jealous of women and express this through hostility. I don’t know if a solution, in some cases, is all-female and all-male companies, however I don’t think these should be prohibited by law from existing.