I encourage everyone in tech to read Unlocking the Clubhouse, by Margolis et al. It doesn't quite propose how to solve the problem, but it certainly teases out a number of contributing factors. I think in the case in point, the importance of being encouraged/discouraged depending on gender cannot be understated. Of course, to the individual involved it'll feel 'normal' since it has always been that way, but on a societal level it is blatantly obvious that children are moulded into gendered expectation patterns from literally the moment they're born. (As to that last assertion, there's a study floating around on how adults react to a baby crying then told the child is either male or female. Quite saddening.)