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.

  • Canonical_Warlock@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    35
    ·
    7 days 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.

    • HubertManne@piefed.social
      link
      fedilink
      English
      arrow-up
      3
      ·
      5 days 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.

    • TrackinDaKraken@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 days 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.

  • Caveman@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    6 days ago

    I call one of my coworkers once a week with “Can I rubber duck you?” which means I’m just going to talk about my problem and explain my thought process in hopes she spots an obvious solution.

    We do it to each other and 30% of the time the other dev says “why not just X” and we agree that it’s pretty obvious.

    • nullptr@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      7 days ago

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

  • feinstruktur@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    ·
    6 days ago

    But isn’t that well known, even from school days? If you’ve ever explained something to someone you’ve recognized that by doing that you’re forced into overthinking the context, diving deeper into the subject.

  • GreenKnight23@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 days 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.

  • fibojoly@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    5
    ·
    7 days ago

    A corollary to this is that it’s often very difficult to explain what’s wrong because if you could explain it clearly, you would probably be fixing it already.

    • RavenofDespair@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      6 days ago

      it is the process of explaining how your code works (or should work) to someone that you realizes the errors or solution.

      • fibojoly@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 days ago

        Precisely! The process of putting your thoughts in order to explain things usually gives me the answers.

  • doesit@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    5
    ·
    7 days 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.

  • Chaos_99@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 days ago

    I don’t know who initialyse selected the rubber duck as a symbol for that. But it can’t be a coincidence that the method works even better for me while showering.

    (Although with that, the energy costs might rival that of AI use)

  • hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    5
    ·
    7 days ago

    My wife is my rubber duck. She doesn’t mind when I explain the most jargon-heavy stuff to her.