I've been assigned the position of Teaching Assistant for the programming part of my university courses in Bayesian Inference, at the MS level. I previously taught a course, a few months ago, in Computational statistics. My experience doing this, with no previous teaching experience, has been not so great because of generally poor student's performance, probably due to a lack of familiarity with the programming language used (R).
I am preparing slides lecture by lecture, with embedded code that I run and comment upon on-the-go. Occasionally I propose exercises but execution is often sketchy and I find many people cannot use the basic constructs of the language with enough fluency to create code that runs "on the spot". Given that I have a program to cover and I would not know what else to propose to the students other than exercising more and studying the syntax of the language -- I am, myself, in most regards self-taught about this, meaning that my programming abilities have little to do with the coursework I did during my studies -- do you have any advice on how to make my lectures more effective and stimulating?