Teaching style - slides, live coding, both?


I was asked to teach a four-day (4 hours per day) data science course for absolute beginners. I think I have all the material I need but I'm not sure what is the best way to teach programming.

I thought of doing mainly live coding, but I feel like I should also have some slides. But at the same time, I'm not sure if slides will help people learn to program in R.

Could anyone share what they think will work best?


In my (grad) classes and bootcamps, I show very little slides and spend most of the time running through exercises via live coding and hands-on exercises. For slides, I typically start the instruction by showing what is possible in order to get the students excited, and from there, discuss the topics that we will cover and why they are important.

For the hands on part, I live code using a commented script in front of the students, talk about how/why things work, and then ask the students to complete short exercises. Simply, 5-15 minutes of my instruction and overview depending on the topic, and then ask them to work through increasingly complex simple code challenges (3-5 questions), in which they get 10-20 minutes to complete on their own.

During the hands-on work, I am walking around the room answering questions as needed. If you wanted a variant of above, I would start out with live coding in front of the students (laptop down), run through some guided examples with the students, laptops up, and then have them complete a few code challenges on their own.

Regardless of the approach above, I repeat this process for the entire class meeting. It may seem repetitive, but I have had outstanding evals over the last two years with this approach, and one that has worked for both R and python instruction.

Of course, as the class meeting starts to near the end of the time allocated, I attempt to create a code challenge or two that pulls everything together to round out the core learning objectives and tie up the material that was covered.

I hope that helps, but from my experience, I would stay away from slides. I have tried it, and while it may work for others, I have found that approach to be disruptive.

1 Like

Thank you so much, this helps alot. I like this setup.

One question. When you say, live code using a commented script, what do you mean by that?

What I do is create an R script (or python script) that is uses comments to create the outline for what I am going to talk about. I will start out with learning objectives, setup/imports, and then simply use comments to introduce the topic/exercise. It is't verbose, but enough to create an outline to follow and give the student enough so that the script can act like a set of notes that they can fill in along the way. I use this script for the whole class, and by the end of the session, it has all of the code that we ran through, including the exercises. I send my version of the code to everyone after the session as well.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.