The best way of teaching coding is firstly in the manipulation of interesting simulations, firstly where the manipulation of inputs into the simulations alters the outcomes and then reviewing the underlying algorithms and how changes there further alter the outcomes. This provides access to much more complicated programs that in total are out of the intellectual reach of learning students but far more interesting, so while the whole program is far to complex, elements of it are within reach and draw the students to programming and the problem solving that can be achieved with programs.
Complex stuff, like weather modelling, which would allow a range of subjects to be taught simultaneously (programming, weather, physics, maths etc), can be very worthwhile simulation teaching exercises. Flight modelling also provides similar simultaneous learning opportunities. So rather than focus on boring coding, focus on problem solving than can be achieved by coding in complex detailed simulations, from social dynamics in city building to space launch and the human body and health, there are a range of interesting outcomes and many solutions that come together to achieve them.