You need your best professors and resources on the first 2-3 courses and everyone who comes out of those courses needs to "get it." Otherwise, everything afterward suffers and waters down. And without that stuff after (algorithms, operating systems, OOP, etc.) most students leave completely unprepared and barely understanding the stuff from those first few classes. And whoops, it's 4 years later.
Harvey Mudd is tiny. People always cite the percentages it has regarding gender balance, but the fact of the matter is that Mudd's incoming classes are smaller than 200 people and every single person applying has self-selected to go to an exclusively STEM college. This makes it very, very easy (relative to other colleges) for Mudd to basically pull a disproportionate number of already CS-inclined women from the pool of applicants with a bit of heavy marketing and effort. Mudd spends a large amount of resources trying to convince girls to attend, especially ones interested in CS, a personal interest of the president. Additionally, about 6 years ago they did something to revamp the admissions process which took the incoming classes from about a 2:1 male:female ratio to an even ratio (literally the incoming class for 2013 and every previous year was >60% male, and 2014 was magically ~50/50). This is remarkable for a school catering only to high-performing STEM students.
But it doesn't apply in a general sense. This model works for a tiny niche school in a big, big market. It will not work for every (or even many) schools in the market. And when you are pulling in classes where there are nearly as many CS-inclined women as men, it makes it a lot easier to have an environment that doesn't drive them away. But not every school can do this, it is literally impossible.
I have an incredibly smart friend who went to Oxford to do maths. His "competition" at Eton had sat the maths A-Level a year before normal, and had spent the last year studying university-level texts, and he was playing catch-up. Not sure who that benefits.
While I agree that people might have a good amount of experience of writing software before university/school, I'd be surprised if they were well versed in Computer Science (which I think is more focused on the mathematical/algorithmic side at first).
(I studied CompSci at Cambridge)
By the way Harvey Mudd seems to have solved the issue.
"With leadership from the college president and college-wide support, Harvey Mudd increased the percentage of women graduating from its computing program from 12 percent to approximately 40 percent in five years. This dramatic increase was accomplished through three major changes: revising the introductory computing course and splitting it into two levels divided by experience, providing research opportunities for undergraduates after their first year in college, and taking female students to the Grace Hopper Celebration of Women in Computing conference."
https://www.hmc.edu/about-hmc/2015/03/26/new-report-on-women...