What is a rubber duck and what is it for?

15

There is an expression used from time to time in the middle of programming that concerns working on code with a rubber duck. How does such a duck help you develop software in a better way?

    
asked by anonymous 05.06.2017 / 16:34

2 answers

16

Duckling,duckling,istheremorecrookedcodethanmine?Source: Talk to the duck - debugging and resilience

Despite the strange name, Rubber Duck programming is a software engineering technique that attempts to eliminate cognitive dissonance between the mental elaboration of a software model and the solution to a problem. / p> The premise is that by explaining to an external agent (in this case the rubber duck) his problem, the necessary organization will offer the engineer views not usually available only via a mental model, aiding the debugging process.

    
05.06.2017 / 16:45
10

It's a code debugging method, where in explaining how code works to a third party, any inconsistency between what the code should do and what it actually does would become more apparent.

The term refers to the history of a The Pragmatic Programmer book where the programmer explains line by line to a duck.

Font

Another more empirical approach may be the Socratic method .

    
05.06.2017 / 16:51