Of course some of the problem is that CS programs use computers so much. Which I know may seem like a silly complaint, but I think the fundamental issue is CS-the-science being mashed together with what's really a vocational program (which is what 99+% of students and employers actually want out of it, and its being "real" CS is mostly just an IQ filter). I imagine if you go into, say, a junior college HVAC program not knowing which is the business end of a screwdriver, you'd also be at a big disadvantage compared with most of your peers, and probably feel really out-of-place for quite a while.
I took MIT's "Intro" to Programming and Algorithms I think it was called (6.001). I'm not a professional developer but I've written a fair bit of code including Python which is what the class used. I'm pretty sure that, as an undergraduate, had I never seriously used a computer command line before, there is no way I could have gotten through that course.
The same dynamic is largely missing from other engineering courses, as well as the sciences, which don't really expect more than high school classroom work, an interest, and general aptitude.
And it's certainly true that CS (the math degree) gets munged with CS (the engineering degree). MIT's a bit more engineering focused (the degree is in the engineering school). There are also some variants of the degree that are more or less engineering-centric.
You're not going to meet that kind of abrupt and early resistance on the path to becoming a doctor because you didn't spend tons of your free time as far back as junior high reading anatomy books or practicing dissection, for instance.
Again, there are almost certainly other factors, and correlation is not causation, but there is at least logical correlation.
To your broader point, a lot of kids enter college with only a broad idea of what they want to do. And high school courses don't really offer much guidance. High school science classes have very little to do with their counterparts at good colleges.
[1] https://www.aei.org/carpe-diem/chart-of-the-day-the-declinin...
Meanwhile there are definitely a lot of gatekeeping-assumptions about childhood interests in modern CS programs, which one would expect to have gotten stronger as more and more freshmen actually could have had experience with computers on their own—so, starting with late-80s freshmen, mostly, with the effect getting stronger fast after that. That lines up so well with the data on CS-program-enrollment-by-sex that it seems to me like the factor to examine before we go looking for other explanations. Again, to be excessively explicit due to the topic, I mean this in terms of accounting for the gender gap in programming, not in terms of addressing any other issues of sexism in the industry, which I am not denying exist.
It's much more inclusive indeed. If you can afford the mandatory completely unrelated undergrad you need to have completed to even apply to med school and the travel fees to attend your in-person interviews of course.
No, instead it's unrelated to the field so you can grind fractions of GPAs against other applicants. At least, CS is kind enough to let everyone try the real thing.
They don't call it the firehose for nothing. [0]
There's been some research on this and places like Harvey Mudd solve this basically by dividing the incoming freshmen into 'has any experience at all programming' and 'completely new', which was like 50-50 if I recall. And then tweaking assignments to not be video game focused -- pulling in problems & themes from bioinformatics and other fields instead.
Our only program of any significance in CS101 was a space invaders clone, but because we were so inexperienced, they provided a project template where we really just had to fill in some methods with a bunch of for-loops. When we got to the later courses and had to write our programs from scratch, we really had no idea where to begin because the 101 coursework had done all of that for us.
The video game assignments were asinine because they were beyond our skill level to do from scratch, so their templates handled all the I/O for us and that part of the program was treated like a bunch of magical incantations. As a result, we never fully internalized how all the moving parts fit together, and it kept us from learning useful stuff like how to read/write from files or execute system commands.