This 100 times..
I had been taught by “theory” and “just learn this bit” style professors for C++ and other similar languages, with insane rigidity (you MUST solve the problem this way, how dare you do it more elegantly or use better input methods etc) ..
It was not until Swift Playgrounds that I finally had a good tutor telling me why you should use a for-loop, vs a Do Until or other similar functions. Now my has wife started learning too, and she’s a “natural” impressing me greatly with her problem solving and the ease she seems to have, “breezing through” solving the puzzles on the first attempt!
Context is key. Same thing when teaching math, if we were told Why or how these things applied to real-life or shapes and etcetera I’m sure the students would have paid far more attention and actually remember stuff post-exam.