Altogether exasperating...
In hindsight I think the Uni courses that taught coding into a language were starting with wrong end of the horse.
(In my case Fortran IV, Snobol, Algol and later Pascal. C was accidental - I picked up an early copy of K&R "The C Programming Language" that had been shipped with a Z80 Cromix system.)
I think much of the time could have been better spent on teaching first order logic and the basics of formal specification as well as the basics ideas of computational linguistics - syntax and semantics.
For example later understanding the statement syntax of Pascal (cf C) would remove the confusion over the use of semicolons.
As a BOFH I have had students knocking on my door with their non working code that didn't understand de morgans laws (duals) ie they believed ".not. (A .and. B) = (.not. A .and. .not. B)." Ye gad did ye no try substituting "true" for A and B?" Clearly didn't understand the idea "satisfied in all models."
Another area that prefigures coding is an introduction to the study of algorithms. With a handle on basic algorithms a student can analyse a problem using higher level concepts like searching, sorting etc without considering too many implementation details.
Rather than foisting the current AI miasma onto students I would repurpose existing tools like proof checkers, executable specification systems, declarative and functional programming systems to target teaching introductory software engineering courses.
Why wouldn't you exit a loop with a goto, return etc? (One) answer: you are unlikely to have preserved the loop invariant or know whether the loop guard is negated (~G or Inv.) I could not convince a very smart and experienced software developer that this perspective had any merit. Probably it was fortunate we were on the ground (and only) floor in case the BOFH genes had kicked in. :)
Fifty years on, Edsger Dijkstra must be rotating in his grave, we appear to have made bugger all progress. If anything software and systems development is going backwards at warp speed.