2
Just realized using a rubber duck actually works for debugging
I was stuck on this one little bug for like 2 hours last Tuesday. It was a simple HTML form that kept breaking when I submitted it. I tried checking the console, looking at my code line by line, even asked my buddy who knows way more JavaScript than me. Nothing was working and I was about to just give up. Then I remembered someone in a tutorial mentioned talking to a rubber duck. I grabbed this old rubber duck I got from a carnival years ago and just started explaining my code out loud to it. Halfway through describing what the submit button was supposed to do, I realized I forgot to add an event listener to the form itself. Soon as I fixed that, everything worked. Has anyone else had that moment where you explain your code to something dumb and suddenly see the answer?
3 comments
Log in to join the discussion
Log In3 Comments
grant.felix6h ago
totally agree with nora110 about "the act of saying it out loud" being the real trick. I've noticed it works outside coding too. Like when I'm trying to figure out why my car's making that weird noise, if I explain it out loud to my neighbor it suddenly clicks. Or when I'm trying to remember where I put my keys, saying "okay I came home, dumped my bag on the couch" out loud triggers something. It's like our brains need to hear the words to actually process the steps, not just think them in a jumble. The rubber duck is just an excuse to start talking.
9
the_diana4h ago
The rubber duck might be the most underrated coworker in tech. Louder than some of my actual colleagues but way more helpful because it never interrupts with "have you tried turning it off and on again." I once explained a bug to a houseplant for 15 minutes before realizing the plant was fake. Still worked though which says a lot about my debugging skills. At this point I'm convinced I could talk to a brick wall and it would tell me where my missing semicolon is.
4
nora1108h ago
Completely agree with this, it's wild how well it works. I had the exact same thing happen last month when I was trying to fix a stupid loop that kept crashing my project. I was talking to a little plush fox on my desk and about three sentences into explaining what I wanted the loop to do, I realized I had the condition wrong the whole time. It's like the act of saying it out loud forces your brain to actually process the logic instead of just staring at the screen. That rubber duck probably saved me another hour of frustration.
1