The Power of Rubber Duck Debugging: How Teaching Helps You Learn

Sometimes we learn best when we're teaching. I found this to be true when I was a Biology teacher, and I've found it to be true in my time at DigitalCrafts.

For example, as a Biology student in college, I learned about osmosis. I read about it, watched videos, and was even able to answer some test questions when the occasion arose.

But here's the thing: I didn't really understand why osmosis was taking place or how molecules moved until I became a high school biology teacher and had to teach the topic to groups of teenagers.

The same thing happened when I was a student at DigitalCrafts. Even though I listened to lectures, watched tutorials and even built some projects using React, I struggled to understand certain elements of it. It wasn't until I became a Developer in Residence here and had to teach students that I could say I'd really learned React. 

We see something like this in programming with rubber duck debugging. Rubber duck debugging works like this:

  1. Obtain a rubber duck (or any other object).
  2. Explain the goal of your code, line by line, to your duck.
  3. At some point, realize the code you have written is not accomplishing those goals.
  4. Begin to find where your code is falling short.

Through this process, students are able to identify errors in their code and learn from their mistakes. By forcing yourself to explain a concept, even to a rubber duck that can’t respond, you can unveil your misconceptions.

You may be thinking, “But I don’t know enough content to teach it!” And that's not surprising. One of the biggest issues developers face is imposter syndrome, where we doubt our abilities. Heck, I’m even feeling it as I write this post. 

First off, you know more than you think! Don’t compare yourself to others; compare yourself to you a month ago. 

And as you explain your train of thought, you will probably realize you actually know more about the subject than you expected. If you don’t, no worries! Now you know where you need to grow. 

So my advice to anyone trying to learn something new, even outside of coding, is to buy a rubber ducky. Find your audience, explain your problems, and see what errors you can catch.

This blog post was written by Katy Gibson, Developer in Residence.

Student Blogger

Articles written by the students and Alumni of DigitalCrafts