But those are different questions. It is not a safe assumption that the best practitioners in this field should be nerds who got started in their pre-teen years (that describes me, by the way). The overwhelming majority of pre-teen computer nerds don't do any software development work of significance. I was out of high school before I wrote my first significant program, which makes my head start not that much different from someone who starts programming in their CS courses at college.
Just to be clear, I did not intend to imply that spending more time in nerd mode might make boys better at programming (or any other STEM field) than girls. I was just looking at why boys might be more likely to go into such fields.
A lot (most?) kids have decided what general area they are going to major in by the time they arrive at college, and those kids are going to be a big factor in the demographics of the fields they go into.
I suspect that this results in boys spending more time in that awkward stage where they would rather spend their time on activities that are done alone or, if done with others, do not require much social interaction.
Girls pass through that stage faster, and more of their time after gets devoted to dealing with their social groups and their positions in those groups.
It is that awkward stage that is prime time for really seriously getting into programming and many other STEM activities. Boys spend longer stuck there, so boys get a head start in STEM.