In teaching programming, I've found that often the hardest thing to learn is how to break down problems logically, not how to write code. For example, if I assign students to write a function that takes an average (mean) of a series of numbers, very few will fail because of syntax errors. Many more will fail because they've never thought about how to take an average!
Therefore, my latest thinking is that the first few programming lessons should be about basic mathematical problem solving. How to compute an average. How to estimate a square root. That sort of thing in a "math" class is assumed given. To a mathematician, the square root of two is "the square root of two" and no computation is necessary. I want to convey to my students that computers have to be taught a process, not an answer.
I'll find out next semester if that's a better approach. I hope you find it helpful or at least interesting.