That was a big challenge of mine in school. I wasn't that interested in the assignments, because I was building boring stuff that didn't really solve problems, let alone ones I cared about.
I am pretty prolific in my career, and I'm not even what you would call a hardcore dev. Which brings me to my next gripe with CS curriculum: It is geared towards training hardcore devs and not any other type of engineer.
The types of coders we should have some sort of curriculum for, which we to this day mostly do not:
-SRE's -Ops people -Support people -PM's -Accountants/General finance -DBA's -SysAdmins -Network engineers -Cloud engineers
What CS curriculum doesn't include networks, relational theory, hardware architecture, os architecture? How can anybody in those roles be successful without at least informally understanding the rudiments of big-O notation or without having some light scripting skills?
Certainly CS curricula could be improved, but a good one doesn't do too bad of a job at preparing you for technical roles IMO.
Those sorts of classes were available when I was in school, but it was not a whole track, it was 1 class each.
Second data point: These are the types of roles I meet in the wild who would benefit from coding, and they usually cannot (or can do some very light scripting).
I cannot explain it exactly. They just usually are missing that skill.