Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

[Off topic] Does anyone rubber duck program?

edited December 2013 in General Posts: 577

I browsing the part of the Wikipedia on programming, and I came across this. Apparently, when a programmer has a error in his code, he will go through all the lines and explain each one to his rubber duck. Do any of you do this, and do you think this is a good idea?


  • dave1707dave1707 Mod
    Posts: 10,055

    When I was still working and someone had a problem with their code, I would have them explain it to me. A lot of times they would realize their problem even though I had no idea of what their code was doing. So yes, explaining code to someone else is helpful, but I'm not sure about explaining it to a rubber duck. I think a live peron would be more helpful because of the responses they could get in return.

  • I don't know any other programmers socially, so the reactions of a live person vs a rubber duck are probably very similar: o_0

  • IgnatzIgnatz Mod
    Posts: 5,396

    I don't rubber duck program, but I have sometimes been advised to test my (text entry) programs with a phone - by dropping the phone book on the keyboard to press random letters, and see if the program handles them properly! It's a joke of course, but with a serious message that users can do very strange things.

    Instead of a duck, I could try explaining my programs to my wife, because she doesn't program, but if know I would just be asked why I spend so much time on Codea when I could be doing something useful like fixing the vacuum cleaner or mowing the lawn....

  • Posts: 536

    The expression Rubber duck or teddy bear to explain the problem to was used from time to time when I was teaching at the university, so I sometimes think about it, and it can help to try to explain the problem out loud or writing it down.

  • Posts: 1,976

    @Prynok and I chatted about this in Skype. I suppose I can see how it could be useful.

  • edited December 2013 Posts: 1,595

    @Prynok the brain interprets language many different ways when it's said out loud, if you try to think about it too much you can end up stuck in a circle, because it might make sense when you repeat it to yourself in your head but can be different on paper, this isn't just something that works for programming as you may have guessed.

  • @Prynok I don't talk to a rubber duck, but when I get stuck, I lay my ipad aside, watch some tv/play games for 30min, then I take paper and pen, and start drawing/doing math, which eventually changes into a chunk of code, I then take my ipad, edit my 'test' project (project used to test chunks) and as I start typing all of the code, I make minor changes because those look... correcter, then I test it and that way I already solved alot of problems, for example my color chooser, I did alot of thinking and 'coding' on paper for the hexagon

  • I just talk to my program, asking it what object it is, what's its purpose in life and what it's doing right now. Most common issues? . vs : and sending a message to the wrong object.

  • Posts: 1,595

    @syntonica I hope it never talks to you! ;)

  • @Luatee Well, there is the text-to-speech option...

  • Posts: 2,161

    This sort of discussion always reminds me of the play "Copenhagen" in which there is a repeated refrain:

    But in the end, in the end, remember, we have to be able to explain it all to Margrethe!

  • Rubber duck? Naw, I use my cousin Charlie. He's a spider. He has so many cousins that there is always a charlie hanging around I can talk to. I tried ants, but they scurry away after I start talking. Lady bugs work a little bit better, but eventually they fly off. Nope, spiders are the best, they hang around and listen for as long as you want. They don't talk back either and some times a random insect flies into the web which spices up life a little bit.

  • Posts: 1,976

    @MrScience101 You're kidding, right...?

    I have arachnophobia.

  • Jmv38Jmv38 Mod
    Posts: 3,297

    @MrScience101 your cousin is a spider... Does that make you a.. Scorpio? Or a crab? Then how can you use the ipad keyboard then? The tip of your legs do not have enough capacitance to be detected... Ha! I nailed you: you are lying! ;-)

  • @SkyTheCoder, you need to watch the second movie of the Hobbit series in 3d. :)

    @Jmv38, naw, I work at a nuclear power plant. My cousins and I have mutated enough now that capacitance is the least of our worries. =)

  • IgnatzIgnatz Mod
    Posts: 5,396

    @MrScience101 - I wish I could glow in the dark!

  • @Ignatz, no problem. Come on over and we'll give you a good dose of a few hundred millirem and you should be glowing in no time!

  • Posts: 577

    @MrScience101 Ah, your user name, your profile picture, it all makes sense now!

  • Posts: 1,595

    @MrScience101 You're not human? Radioactive?

  • @Prynok, indeed! Now if I could just figure out what Prynok is....

    @Luatee, it depends upon your definition of human I suppose, I am sure some of my genetic material is no longer as it was originally due to bombardment by neutrons. Hopefully my body is good at ignoring and killing off the mutations before they become permanent. I am only radioactive during certain times (typically bad ones)

  • There are I believe 2 factors at play in rubber ducking or talking to someone else about a problem.

    1) When you say it out load it comes back in your ears, this allows the information to reach different bits of your brain than just thinking about it. Specifically the language areas to say it, and the language areas to hear it.

    2) By talking it through it forces you to work through laying it out as a logical conversation.

    Both of these are why explaining it to someone else often helps, and if you don't have another person, just the discipline of saying it out load can really help.

Sign In or Register to comment.