Programmers often discover solutions while explaining a problem to someone else, even to people with no programming knowledge. Describing the code, and comparing to what it actually does, exposes inconsistencies. Explaining a subject also forces the programmer to look at it from new perspectives and can provide a deeper understanding.

  • becausechemistry@piefed.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    Now, hear me out: what if the rubber duck burned tons of energy, poisoned the water and air, caused a global shortage of computer parts, was built with material without the permission of creators, made it easy to make nonconsensual sexual images of people, and lied to you?

    • AA5B@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      Obviously then you’d trust everything it says and fire half your staff to replace them with a row of ducks

    • 4am@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      It’s a moron detector.

      Most of us would avoid it like the plague, but morons will let it write their code in the first place.

    • Cellari@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      You can fix the world by putting an AI into the rubber duck without electricity and expensive parts and it still works!

      AI enhanced by that smile and those eyes and quiet posture helps solve problems :)

    • shrugs@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      Yeah, but it always tells me my ideas are good and he is wrong. So there is that

    • affenlehrer@feddit.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      But this rubber duck knows about programming. However, especially early on the duck lied a lot and now often insists that the API version it learned a year ago is still the latest and everything you’ve done with the new one is wrong. Well, now you l can let it read the new documentation beforehand but it’s still a weird rubber duck.

      • affenlehrer@feddit.org
        link
        fedilink
        English
        arrow-up
        0
        ·
        6 months ago

        I hope NPU hardware like CIX Clawcore will become more common for Developers. They can run 30B models locally and these smaller models are getting better and more efficient as well (MoE etc).

        The hardware still burns energy and resources and costs money but locally so you are responsible for it and don’t externalize everything into some data centers and investor / public money.

        • 4am@lemmy.zip
          link
          fedilink
          English
          arrow-up
          0
          ·
          6 months ago

          I admire your optimism.

          You know what hardware is going to become common with developers? Dumb terminal tablets and cloud accounts, unless we stop the capitalists right away.

          • affenlehrer@feddit.org
            link
            fedilink
            English
            arrow-up
            0
            ·
            6 months ago

            You’re not wrong. At work I have the bizarre situation that I have a laptop which is pretty powerful but I’m not allowed to develop on it and have no admin rights on it so I have to remote desktop into a less powerful VDI running in a different country with exactly the same access to company information but I have local admin rights on that machine. Also development is super cumbersome because it’s a windows VDI so I have to use WSL2 for a lot of the things I’m doing. Really weird, inefficient and expensive.

            • 4am@lemmy.zip
              link
              fedilink
              English
              arrow-up
              0
              ·
              6 months ago

              Same, my work laptop is locked down hard but I have admin access to some production servers.

              I guess it comes down to they trust me, but they don’t trust the networks around me.

      • halcyoncmdr@piefed.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        6 months ago

        exploit and traumatize developing country workers to filter nsfw/nsfl

        I’ve always felt like there’s a place in there for the early internet users through millenials (and maybe some early Gen Z) who spent a lot of time getting tricked by places like 4chan to see nsfl stuff and developed a tolerance to that sort of crap.

        I’m sure there are a lot of people that already gave up on humanity years ago and have the psychological damage/callouses to deal with that more than a random selection of a population that hasn’t been affected yet. Let the already damaged use that ability, like a super power, to save those who haven’t experienced enough to the point where they’ve given up yet.

        • oce 🐆@jlai.lu
          link
          fedilink
          English
          arrow-up
          0
          ·
          6 months ago

          I don’t think they care as much for minimizing trauma as they care for cheap labor from a developing country. I doubt there are a lot of 4chan users there.

  • kurikai@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    works even for non programming stuff. its letting our brain process the information in order ans organising it

    • SlurpingPus@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      I write a lot of notes, because I can’t trust myself to remember details of any project after a day or more of hopping through multiple other tasks and online information onslaught. This particularly concerns any problems on which I get stuck — and whaddayaknow, writing out what specifically doesn’t work and how it should work, helps with realizing why it might not work.

    • nullptr@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      the number of times I found the error, while describing the error on stackoverflow …

  • da_cow (she/her)@feddit.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    While I havent explained my code to a rubber duck I did find The solution to my Problem just because I started to write it down in order to get help in a forum.

  • curbstickle@anarchist.nexus
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    I have a few Lego kits my kids have gotten me, and a small toy penguin, which I talk through things with.

    Thankfully it looks like I’m just on camera. Though I work from home so it doesnt really matter.

    I also treat several coworkers like my rubber ducky. I warn them first though, so I feel like its not as bad.

      • curbstickle@anarchist.nexus
        link
        fedilink
        English
        arrow-up
        0
        ·
        6 months ago

        … Actually one of my coworkers did squeak like one. She figured out why I called about 5 seconds in and just went “squeak”, which made me burst out laughing, and honestly it just got my brain where it needed to be even quicker

  • MurrayL@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    Not quite the same, but sometimes when I’m doing a task I like to talk through what I’m doing out loud as if I was showing someone else how to do it.

  • doesit@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    I used to teach design. Before a presentation, I always asked my student to explain their project to someone with no knowledge on the subject, like their grandmother or so. Mainly to discover the logic flaws in their presentation.

    • Snazz@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      I’d say brainstorming is what you do before writing code and rubber ducking is what you do to debug code that you’ve already written.

      They also work kinda differently. Brainstorming an idea is different from explaining it out loud, detail by detail.

    • BorgDrone@feddit.nl
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      No. Brainstorming is when you’re with a group and everyone is throwing out ideas unfiltered.

      Rubber duck debugging is when you are trying to solve an issue by describing your problem to another person (or a rubber duck) and through the act of describing the problem you gain a better understanding of the issue and often this causes you to get a ‘eureka moment’ where the solution is suddenly clear to you.

      • GladiusB@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        6 months ago

        I mean in my line of work that is the collaboration process. Our problems are not in “debugging”. However it’s real solutions to problems. We discuss ideas and execute the one we feel is best. Quite often these discussions create that moment you speak of. Perhaps it’s nuanced to programming.

        • [deleted]@piefed.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          3 months ago

          No, it isn’t nuance. You are describing a completely different part in the process.

          Rubber ducking is after you decided on a solution to a problem that you know should work but it isn’t working the way you expect. “Why isn’t the change I am making doing the thing? It works on the other site and oh shoot I forgot to add in the workaround for our goofy environment.”

          • GladiusB@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            3 months ago

            I don’t see the extreme difference you seem to make it out to be. There are plenty of instances in my industry where something should work but needs to be adjusted to work correctly.

            I still see it as brainstorming. But if coders need their own thing, cool.

  • Canonical_Warlock@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    Not a programmer but at my last job I couldnt count how many times I would walk into our engineers office and start explaining a problem only to stop mid sentence and say “wait, I’m an idiot” then walk back out. Sometimes talking about it is all you need to make the pieces fit.

    • TrackinDaKraken@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      Works with writing fiction, too. I read the section aloud and explain the reasoning behind the choices, and that helps me figure out what isn’t quite working. Also, reading aloud makes awkward dialog stand out more so than reading silently.

    • HubertManne@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      came to say this and in addition its more effective with an actual person even if they don’t say anything. Even a small amount of feedback helps that much more although ironically though it kinda palteus if it stops you from jumping on your new ideas and getting them down.

    • MoonRaven@feddit.nl
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      It might have escalated a bit after that though. There are hundreds of rubber duckies all around the office now…

  • GreenKnight23@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 months ago

    fun fact, I used to do this and had a small mental breakdown because my piece of shit boss refused to listen to my solutions, ultimately causing me more work and stress because the solutions he forced me to implement failed even more spectacularly.

    I burned the duck as an effigy of my boss when he was finally fired.

    I will never have another duck.