Anyone who slings code for a living knows the feeling all too well: your code is running fine and dandy one minute, and the next minute is throwing exceptions. You’d swear on a stack of O’Reilly books that you didn’t change anything, but your program stubbornly refuses to agree. Stumped, you turn to the only one who understands you and pour your heart out to a little yellow rubber duck.
When it comes to debugging tools, this digital replacement for the duck on your desk might be even more helpful. Rubber duck decoding, where actually explaining aloud to an inanimate object how you think the code should run, really works. It’s basically a way to get you to see the mistake you made by explaining it to yourself; the duck or whatever – personally, I use a stuffed pig– is just along for the ride. [platisd] took the idea a step further and made his debugging buddy, which he dubs the “Dialectic Ball,” in the form of a Magic 8-Ball fortune teller. A 3D-printed shell has an ATtiny84, an accelerometer, and an LCD screen. To use it, you state your problem, shake it, and read the random suggestion that pops up. The list has some obvious suggestions, like adding diagnostic print statements or refactoring. Some tips are more personal, like talking to your local guru or getting a cup of coffee to get things going again. The list can be customized for your way of thinking. If nothing else, it’ll be a conversation piece on your desk.
If you’re more interested in prognostication than debugging, we have no shortage of Magic 8-Ball builds to choose from. Here’s one in a heart, one that fits in a business card, and even one that drops F-bombs.
A polyhedral dice with suggestions on the faces would probably achieve the same goal; i only mention it in case there’s a software bug that stops the digital one from working.
“Rubber duck decoding”?
I’ve heard it, more often than not, called rubber duck debugging.
Sometimes we will start to tell somebody your issue and come to the fix by yourself. This is because your using different segments of the brain to articulate it verbally. The point of the rubber duck is about doing this step without bugging your “local guru”.
Hey!
Got any grapes?
I prefer to use a little teddy – then I can call it ‘bear programming’…
I’d find that unbearable. ;-)
Maybe by “teddy”, he is referring to a type of lingerie…
I have a rubber chicken that originated from the quote that “This thing is so messed up that the only thing left to do is wave a dead chicken over it.” Having had a long career in engineering with lots of lab time, the chicken has been replaced a few times since the rubber dries out and they disintegrate. The rubber chickens still last a LOT longer then a bio chicken and don’t smell as bad.
For some reason I’m off in a thought of “rolling my own inductor/coils using a pedometer or accelerometer with a mechanical lever on the shaft” to digitize and log work.
Many decades ago when I was a COBOL programmer we had a (continually renewed) bag of oranges in the office that fullfilled the role. When puzzled by an error the analyst would pop the bag on the desk for us to describe the problem to. Amazing how often it worked. Gave the analyst a break from spotting the inevitable missing full stop.
“…You’d swear on a stack of O’Reilly books…”
And you don’t have a clue as to your problem, do you?
Came to the comments just to ensure this was in here.
Thanks, but I’ll stick to my divining rods
I’d rather by driving hot rods with a stick shift!