I teach programming, too. My way of teaching is not much about computer, it's more about thinking, drawing and writing (not only code). - Thinking about steps, divide and conquer. - Drawing or visualizing the steps. - Writing documentation clearly before any code is written. Most of new programmers tend to think just make program work means DONE. No, it's not, it's just the last part of what to be done.
The single most useful thing I ever learned was how to break down a problem, make steps to a solution, make a flowchart of said steps, and annotate the flowchart with pseudo-code. After that, making the software was trivial. Even with that toolset I’m likely mediocre at best.
This is how you end up with software that does the job it needs to do perfectly well when all of the expected inputs and environment are correct, but completely fails if anything unusual happens, because 'it wasn't in the flow chart'.