Five Lessons I Learned from Teaching
Ryan Sobol, experienced (and well-travelled) software developer, shared his initial thoughts after he guest lectured at Code Fellows last September. Since then, Ryan has taught our Foundations II: Ruby course and is assisting with the inaugural Computer Science & Web Development Bootcamp. Read on for his thoughts on the first time teaching at Code Fellows.
This week, I’ve been crazy busy preparing for my upcoming Bali adventure (just 3 weeks left!), But, before I forget, I want to share with you, and my future self, what I learned while guest lecturing a Ruby on Rails course with Code Fellows here in Seattle, WA.
My lecture was on singly linked lists. And I feel that it’s an important one because I’ve been asked to draw and/or explain linked lists in every technical interview that I’ve ever been through.
So, here are five lessons that I learned while giving this lecture:
1. Start with a good analogy
If a picture is worth a thousand words, a good analogy is worth at least a few hundred. For my lecture, I coupled singly linked lists to matryoshkas, or Russian nesting dolls. My objective was to make a new and unfamiliar concept more meaningful to the students through this analogy. And it worked!
The students transferred what they already knew about nesting dolls to the concept of singly linked lists. While the analogy isn’t perfect, it’s better than starting from square one.
2. Present one new idea at a time
I thought that I was going to nail this one. But, as it turned out, I could’ve done a better job.
You see, prior to class, I divided the concept of singly linked lists into small, bite-sized chunks. I gave a few practice lectures to my fiancée, and she liked the way that the material flowed.
However, during lecture, some of those chunks were needlessly confusing for the students. I’ve come to the conclusion that my sample code needed too much explanation.
I’ve since gone through and replaced all of the production-quality code with what I call teaching-quality code. Now, the material flows well and is more beginner-friendly.
3. Constantly weave in the analogy
While I started with a strong analogy, I forgot to refer back to it when the students and I got to the nitty-gritty.
For example, properties and operations of an intangible thing—like a class—are hard to imagine in the mind. I would have done better to define these properties and operations in terms of something more concrete, like a matroyshka doll. As we transitioned to the
SinglyLinkedList class, the students and I would’ve been on more solid ground.
Lucky for me, one of the other instructors piped up and made the connection for me. And I noticed it really helped shape the discussion.
4. Use visual aids
I cooked up a medley of diagrams prior to lecture. Hands down, they were the star of the show and my saving grace.
With diagrams like the one below, I was able to pull back the curtains and reveal the inner workings of a
SinglyLinkedList class implemented in Ruby.
The next step is to incorporate animation. I believe that animated diagrams are the most effective communication tool for visualizing the changing internal state of class-based, object-oriented code.
5. Finish with production-quality tweaks
Earlier, I explained my motivations for replacing all of the production-quality sample code with what I call teaching-quality code. However, I never explained the difference between the two.
In my experience, production-quality code balances maintainability with readability. Conversely, teaching-quality code sacrifices maintainability for readability. In other words, teaching-quality code ought to be as explicit and direct as possible.
I now believe that teaching-quality code is the best way to introduce a new concept to a fresh mind. However, there’s value in demonstrating how to refactor it into production-quality code. And not doing so might rob the student of real-life lessons that I’ve learned from nearly a decade of experience.
When I publish my series on how to implement singly linked lists in Ruby, my final article will walk the reader through a few production-quality tweaks and their rationale.
Big thanks, and a big hug, to all of my students who joined my newsletter after enduring my lecture. Once my feet are firmly planted in Bali sand, I’ll have the time to publish all of my lecture notes for you. Congratulations on completing the course and good luck out there!
Check out more resources on Ryan’s blog.