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.
Rubber duck debugging - Programmers often discover solutions while explaining a problem to someone else, even to people with no programming knowledge.
https://en.wikipedia.org/wiki/Rubber_duck_debugging
73 Comments
becausechemistry@piefed.social · 183 pts · 130d
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?
oce@jlai.lu · 54 pts · 130d
You forgot:
halcyoncmdr@piefed.social · 11 pts · 130d
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 · 7 pts · 129d
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.
shrugs@lemmy.world · 14 pts · 130d
Yeah, but it always tells me my ideas are good and he is wrong. So there is that
4am@lemmy.zip · 10 pts · 130d
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.
hperrin@lemmy.ca · 3 pts · 130d
Amen.
AA5B@lemmy.world · 6 pts · 128d
Obviously then you’d trust everything it says and fire half your staff to replace them with a row of ducks
Cellari@lemmy.world · 3 pts · 129d
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 :)
affenlehrer@feddit.org · 3 pts · 130d
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.
Serinus@lemmy.world · 7 pts · 129d
Hey! It's someone with actual development experience.
affenlehrer@feddit.org · 1 pts · 130d
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 · 7 pts · 130d
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 · 4 pts · 129d
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 · 4 pts · 129d
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.
hperrin@lemmy.ca · 4 pts · 130d
You can run a 30B model on a used 3090.
affenlehrer@feddit.org · 0 pts · 129d
True but it needs more room, power and has less RAM. It's probably faster though.
Canonical_Warlock@lemmy.dbzer0.com · 38 pts · 129d
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.
kurikai@lemmy.world · 38 pts · 130d
works even for non programming stuff. its letting our brain process the information in order ans organising it
WHARRGARBL@lemmy.world · 11 pts · 130d
SlurpingPus@lemmy.world · 2 pts · 129d
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.
cageythree@lemmy.ml · 2 pts · 129d
Yeah. I'm no programmer but I've had it often that I couldn't find a solution for a problem myself, said 'fuck it, I'll have to ask the internet', and by writing out what my problem was I figured out the solution so I never even posted the half-written posts lol
Semi_Hemi_Demigod@lemmy.world · 33 pts · 130d
This happens so often with my wife that she’s started saying “quack” when I figure it out
nutsack@lemmy.dbzer0.com · 18 pts · 130d
this is one reason I type questions out before asking them
kSPvhmTOlwvMd7Y7E@lemmy.world · 4 pts · 129d
the number of times I found the error, while describing the error on stackoverflow ...
cows_are_underrated@feddit.org · 3 pts · 129d
Is always funny when you wrote 3 paragraphs just to discard them all because you found the error while typing.
voodooattack@lemmy.world · 17 pts · 129d
It’s all fun and games until the duck talks back.
resipsaloquitur@lemmy.world · 15 pts · 130d
Bazell@lemmy.zip · 15 pts · 128d
Real thing by the way. Works not only with programming.
HubertManne@piefed.social · 4 pts · 128d
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.
DarrinBrunner@lemmy.world · 3 pts · 128d
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.
HugeNerd@lemmy.ca · 13 pts · 130d
True for everything I think.
otacon239@lemmy.world · 11 pts · 130d
I keep one on my desk just for this reference :)
MoonRaven@feddit.nl · 10 pts · 129d
This is why I put rubber ducks at all desks of my it colleagues. It helps.
MoonRaven@feddit.nl · 18 pts · 129d
It might have escalated a bit after that though. There are hundreds of rubber duckies all around the office now...
Quantenteilchen@discuss.tchncs.de · 5 pts · 129d
Oh I know a place that is/was like this but with tiny (or not so tiny) T-Rex figures due to naming things.
4am@lemmy.zip · 9 pts · 130d
Every single popcorn flick from the 80s and 90s has a main character make a big plot-resolving realization while doing early act 3 exposition
If this is such a universal human experience that we wrote it into movies made for general audiences, I think that programmers are not the only ones debugging to their ducks
olafurp@lemmy.world · 8 pts · 128d
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.
PennyRoyal@sh.itjust.works · 7 pts · 130d
The Feynman method
RavenofDespair@lemmy.ml · 2 pts · 129d
thanks did not know this :)
hperrin@lemmy.ca · 7 pts · 130d
My wife is my rubber duck. She doesn’t mind when I explain the most jargon-heavy stuff to her.
saltesc@lemmy.world · 7 pts · 130d
I do this to my main analyst as a last resort; have since day 1.
"Sorry, I gotta rant this one out." Knowing full-well they have nfi what I'm going on about.
Then eventually, that feeling of a clarity bomb going off followed by a period of dopamine fallout.
curbstickle@anarchist.nexus · 6 pts · 130d
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.
myster0n@feddit.nl · 6 pts · 130d
Do you squeeze them until they squeak?
curbstickle@anarchist.nexus · 6 pts · 130d
... 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
whelk@retrolemmy.com · 3 pts · 129d
Noot noot!
fibojoly@sh.itjust.works · 6 pts · 129d
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.ml · 2 pts · 129d
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 · 1 pts · 127d
Precisely! The process of putting your thoughts in order to explain things usually gives me the answers.
doesit@sh.itjust.works · 6 pts · 129d
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.
MurrayL@lemmy.world · 6 pts · 130d
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.
dan1101@lemmy.world · 5 pts · 130d
Also going for a walk, driving, or the other morning I woke up spontaneously about 2 hours early and come up with a solution.
SlurpingPus@lemmy.world · 3 pts · 129d
Prolonged and energetic walks jolt my brain so well that I have a standing task of maybe finding a way of recording audio clips right from the lock screen of my phone. Unfortunately, I know for certain that this will result in a pile of said clips collecting on the phone, as sorting them into notes isn't a priority once I'm back home.
null@lemmy.org · 5 pts · 130d
I do this, but with my half-naked anime figures.
XTL@sopuli.xyz · 2 pts · 129d
https://wiki.c2.com/?CardboardAnalyst
cows_are_underrated@feddit.org · 5 pts · 129d
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.
feinstruktur@lemmy.ml · 5 pts · 128d
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.
DarrinBrunner@lemmy.world · 2 pts · 128d
Sure, teaching is one of the fastest ways to learn.
Lifter@discuss.tchncs.de · 1 pts · 127d
Also see SoDoTo. See one, Do one, Teach one.
https://www.eclathospitality.com/blog/career-management/use-the-sodoto-method-to-learn-anything
Angrydeuce@lemmy.world · 5 pts · 130d
Hell, even just having a completely different conversation can sometimes lead to huge breakthroughs! I've seen it happen!
LillyPip@lemmy.ca · 4 pts · 130d
This has a name? I thought this was just how it works. It’s why we think out loud.
eta: thinking + speaking + hearing engages more of your brain. That’s obvious, right? More engagement == more connections?
RavenofDespair@lemmy.ml · 2 pts · 129d
The Feynman method is another name for it. Thanks to PennyRoyal@sh.itjust.works for this info.
GreenKnight23@lemmy.world · 4 pts · 128d
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.
DarrinBrunner@lemmy.world · 3 pts · 128d
I feel like you burned the messenger, somehow.
GreenKnight23@lemmy.world · 1 pts · 128d
all that duck did was enable him. it caused me to accept his behavior and allowed me to ignore the situation because I felt someone listened to me.
Chaos_99@lemmy.world · 3 pts · 128d
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)
Kolanaki@pawb.social · 3 pts · 129d
If rubber ducks are a sign of bugs, then I do not want a Jeep.
pinball_wizard@lemmy.zip · 1 pts · 128d
Haha! But imagine how many programming problems some Jeep owners could debug all at the same time!
The first time I saw one of those rubber duck heavy Jeeps, I wondered if they were a C++ programmer or something.
Edit: And for anyone unaware - the origin is super adorable. https://en.wikipedia.org/wiki/Jeep_ducking
GladiusB@lemmy.world · 1 pts · 129d
Isn't that just brainstorming?
BorgDrone@feddit.nl · 13 pts · 129d
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 · 1 pts · 128d
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.
snooggums@piefed.world · 2 pts · 45d
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 · 0 pts · 45d
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.
Snazz@lemmy.world · 7 pts · 129d
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.