Traditionally, engineering and other such math-heavy majors are pursued by boys. Although we have taken some amazing steps to close the gender gap in the STEM fields, we still have plenty of room for improvement. It is not uncommon as a female computer science major to be one of only a few girls in a giant lecture hall.
It is upsetting to think about the reasons why girls do not choose to take these classes, but it is also important to mention that what we do with our lives is our choice. Although it is important for girls to start pursuing STEM degrees, no one should do something that they do not want to do.
The whole point of supporting girls in these fields is to allow girls to do the things that they want to, regardless of society's take on it, so forcing girls to do these things is taking away their right to choose what they want to study.
On a similar note, girls in STEM fields are rarely treated differently.
Most of the people that I have met have thought it is cool that I am doing computer science. How successful or unsuccessful we are is entirely on us - these fields are very difficult and it is imperative that you work hard, regardless of gender. Plenty of women are quick to accuse the hard parts of their experience of being a woman, but in reality, everyone has to go through it.
The best way to encourage girls to look into science and engineering is to support any interest they have and encourage them to pursue these interests.
The answer, however, is not to force them to try to do coding or other activities that are supposed to teach them how to become a STEM major.
A perfect example of this is a doll sold by Disney called Dance Code Belle. Unlike many other toys, the children must arrange a pseudo-code to use the doll. Although kids are very tech-savvy now, this often goes over the heads of the children it is targeted at, who are as young as five years old. Toys like this may be fun to girls who are displaying an early interest in technology, but some may just want a doll to play, not to practice a future career.
As a whole, we need to sit back and consider the thoughts of the girls before we go on to try and get them into STEM. They have to truly be passionate about it in order to do well. In order to really remedy the gender gap, we need to encourage girls who are already interested in these areas to continue on, rather than force girls to take these classes (very similar to how we treated them with English, education, and nursing – feminine jobs).