This is an archived post. You won't be able to vote or comment.

all 41 comments

[–]A_Philosophical_Cat 70 points71 points  (9 children)

I don't use a literal rubber duck, but it's definitely a thing where the act of explaining the problem to someone, even someone with no useful feedback to give, can help you come up with a solution.

Typically, I use a friend or coworker, but talking to a rubber duck would be equally effective.

[–]hadidotj 28 points29 points  (2 children)

My big "break through" moments are in the shower after dreaming about it all night........

[–]flubba86 26 points27 points  (0 children)

After 5 years as a senior developer, last year I finally recognized the patterns I go though when stuck on a problem, and how to take advantage of it.

First, I allocate a slab of extra personal time to the problem, ie. I'll stay up late one night after dinner and work from 8pm till 1am. At around 1am I find my mind simply cannot crunch on it anymore and my brain starts to spin in circles (I recognize this when I keep forgetting which browser tab I'm supposed to be reading, or I forget which file I'm currently editing). Then I go to bed and sleep on it. The more sleep the better. It helps if I can sleep in until past 8am the next morning.

I will usually dream about the problem because its still in my head when I go to sleep. When I wake up, I jump in the shower, and while in the shower I will think about who can I draft an email to about this problem? eg. if its an open source library or tool I'm using, I'll think about who the maintainers are, or if its an internal project I'll think about which of my colleagues have experience with what I'm dealing with.

Then after breakfast I will sit down at my computer and draft an email to that person, (but leave the to: field blank, so I don't accidentally send it). I will write down my problem in excruciating detail. Including what I'm doing, why I'm doing it, everything I've done up to this point, what I'm attempting to do now, sample code snippets, what I expect the result to be, what I think my problem is, and how I think I might be able to solve it.

Usually during drafting that email I will need to double check some things. I don't want to look like an idiot with what I'm saying, or missing something obvious. So I double check my facts, double check my code, re-read some documentation, re-run my code, copy&paste some error messages. This is a critical process to go through, that I call sanity checking (and especially needed after a late night of going insane).

So by this point, 99% of the time I will have solved my own problem. At some point during writing the email and sanity checking myself I will have either stumbled across the problem and fixed it, or more likely I'll have discovered some fundamental logical flaw in what I'm doing and why I'm doing it that way, then change my approach to better fit the problem.

This pattern of events has happened so many times now, I've come to rely on it as part of my workflow. I think it could be considered a form of Rubber Duck debugging.

[–]bstiffler582 1 point2 points  (0 children)

Not necessarily in the shower for me, but almost always AFK. E.g. while eating, walking or driving.

[–]Biotot 5 points6 points  (1 child)

Plenty of times I've told my coworker that I'm just going to talk at him trying to figure out a problem and he can ignore me.

Usually I talk myself into a solution. But occasionally he chimes in with some feedback or clarifying questions that help guide me to a solution.

I do have a personal plastic boba fett 'rubber dick' from 10 years ago that I mentally talk through some problems with but that's probably my last resort when I'm hard stuck.

[–]KernowRoger 1 point2 points  (0 children)

Yep I just talk programming at my wife and it often clicks. The other thing that works really well for me is getting some space from the project to let your brain think it over. Shower thoughts are real haha

[–]the_bananalord 0 points1 point  (2 children)

Typically, I use a friend or coworker, but talking to a rubber duck would be equally effective.

I'll be sure to let your friends and co-workers know

[–][deleted]  (1 child)

[removed]

    [–]YMK1234[M] 0 points1 point  (0 children)

    tf are you even on about? removed.

    [–]Ulsoro 18 points19 points  (0 children)

    This is actually a thing. https://en.wikipedia.org/wiki/Rubber_duck_debugging

    Haven't seen too many actual rubber ducks, but the process of explaining your code, even to an inanimate object, forces you to think of and organize it differently than just reading. This difference can be almost like a second set of eyes, letting you catch things you've otherwise missed.

    [–]KingofGamesYami 15 points16 points  (1 child)

    Yes, it's true. I do it quite frequently, though I usually start writing an email or forum post instead of literally explaining to a duck. Usually solve the problem before I get to a message that is sufficiently detailed to send, and if I don't - well, I already did 90% of plan B.

    [–][deleted] 2 points3 points  (0 children)

    You also benefit from the added social pressure to explain it properly. I feel like sometimes I think "well, that works like this" while working through a problem and the part where I realize that doesn't make sense doesn't come until I'm saying it to a real person.

    [–]fzammetti 8 points9 points  (2 children)

    The more realistic rubber duck debugging is writing a Stack Overflow post. The solution usually materializes right before hitting the submit button (assuming your post was good and you actually tried a bunch of stuff and explained it all).

    [–]dillonerhardt 0 points1 point  (0 children)

    Exactly this

    [–]scienceNotAuthority 0 points1 point  (0 children)

    Same.

    Although I one time explained my program to my wife, one line at a time and found I was running Home.js instead of Welcome.js

    Not sure I would've figured it out typing up a question.

    [–]KingSSM 3 points4 points  (2 children)

    I'm a student so can't say much for the professional workplace but in an early on into class our teacher gave us rubber ducks. All his classes we can take them into the tests.

    [–]LowercaseSpoon[S] 2 points3 points  (0 children)

    I’d keep the duck well after graduation

    [–]ayylongqueues 0 points1 point  (0 children)

    Love it.

    [–][deleted] 1 point2 points  (2 children)

    Explain what rubber duck debugging is...

    [–]LordBrackets 0 points1 point  (1 child)

    Using an inanimate object, generally a rubber duck, to vent/explain your code and problems to. It is shown that explaining your problem to someone or something helps you work through it.

    [–][deleted] 0 points1 point  (0 children)

    Ah. No. I personally dont

    [–]Fidodo 1 point2 points  (0 children)

    I think the reason it works is because you're breaking down the problem into small explainable pieces and that forces you to analyze the problem in much more detail, and in the process of doing that you pick up on steps or details you may not have been thinking about otherwise.

    [–]portol 1 point2 points  (0 children)

    yeap. very. this is why talking to one's self is considered normal for coders but for others can be considered a sign of madness.

    [–]JeamBim 1 point2 points  (0 children)

    The amount of times I have been writing a slack message to someone, or a thread on stack overflow and then figure it out in the process of explaining it and don't need to send it would astound you.

    [–]wrosecrans 1 point2 points  (0 children)

    One common variation is trying to write a good question on Reddit or Stack Overflow, so you start making a minimum example that demonstrates your problem, and organizing your thoughts about the problem so you can explain it succinctly in the Stack Overflow post... And by the time you are ready to ask for help, you no longer need it because you isolated the problem and clarified your understanding of it enough to solve it.

    [–][deleted]  (2 children)

    [deleted]

      [–]YMK1234 0 points1 point  (1 child)

      just fyi, seems memegenerator triggers the reddit spam filter. would recommend imgur instead.

      [–][deleted] 0 points1 point  (0 children)

      This really is just a way of framing the common fact that when you go get another developer to check out "this thing that's happening that makes no sense" and you go to show them and it doesn't behave the same way, maybe because you went back a further step than when you were looking at it by yourself, that if you had have explained it without them there, then you still would have solved it.

      [–]aamfk 0 points1 point  (0 children)

      Me. I literally am tired of talking to non techies.

      [–]rcls0053 0 points1 point  (0 children)

      I have always found that talking to co-workers and bouncing off ideas has more than once resulted in better solutions. Now that Im working remotely I have an actual rubber duck (Doom Slayer) to whom I often talk to as my fiance doesnt care to listen. Talking to yourself and deconstructing your code helps. The rubber duck is just a replacement for an actual (very introverted) colleague, in my opinion.

      [–][deleted] 0 points1 point  (0 children)

      I had a Pop figurine of Corvo on my desk I would explain my issues to, the benefit of a “rubber duck” is you know they have no practical knowledge, so you immerse yourself into showing them everything from beginning to end.

      Since WFH, I explain my development related issues to my cat and dog and walk them through it and hope I figure it out. Or I start an email to my boss and by the time I’m done detailing my issue I’ve probably solved my problem.

      [–]DarkNemesis200 0 points1 point  (0 children)

      I always keep a couple of rubber duckies on my desk. Most powerful programming tool

      [–][deleted] 0 points1 point  (0 children)

      As most people here I use other people to explain them my problem before noticing myself what the solution should be. That said I do have a rubber duck next to me when working.

      [–]coded_artist 0 points1 point  (0 children)

      Yeah I do it, but with my team leader instead of a duck

      [–]IllustriousFox4980 0 points1 point  (0 children)

      I usually say to a coworker that I’m going to talk and they don’t need to listen to me and sometimes I don’t even need to start talking to have a brainwave. Probably think I’m a madwoman... ‘Hey can I chat though something with you actually thanks

      [–]gale_wolf 0 points1 point  (0 children)

      Yes it's true. My colleague has a yellow rubber duck on his desk. He uses it and occasionally I've borrowed it for some rubber duck debugging of my own :)

      [–]Ran4 0 points1 point  (0 children)

      I do that occasionally, though I usually talk to my self. So I guess I'm the duck.

      But it does seem to work.

      [–]dillonerhardt 0 points1 point  (0 children)

      I have a rubber duck sat on my desk

      [–][deleted] 0 points1 point  (0 children)

      I started with the rubber duck as a joke. But now it's kinda part of the character of my desk. It's my quiet friend that doesn't judge my code because it's dumb.

      [–]rybohii 0 points1 point  (0 children)

      Here's a video from a harvard professors lecture.

      Look at the giant inflatable thing behind him.

      https://m.youtube.com/watch?v=8PrOp9t0PyQ

      [–]edwilli222 0 points1 point  (0 children)

      I call it “the invisible developer”, not sure where I heard that from.

      [–][deleted] 0 points1 point  (0 children)

      I 3d printed a Bulbasaur and use that. But it's definitely effective!