But a lot of women (more than you'd think) are actively
told from an early age that they are not capable of learning math, and that they can't reasonably have a successful career in science or engineering.
This even despite the fact that there are a lot of other women who weren't taught this nonsense, and have been very successful in scientific and engineering fields.
I don't think it's a matter of women not gravitating toward programming. It's more likely a matter of girls being taught that they're not capable of it and not having successful role models who are in these industries.