Rubber Duck Debugging

Why Trust Techopedia

What Does Rubber Duck Debugging Mean?

In IT, the slang term “rubber duck debugging” has been created to describe an often effective yet simple strategy for debugging code. In rubber duck debugging, the programmer sits a small rubber duck (or other inanimate object) near them on a desk or near a computer, and explains the code to the duck line by line.

Advertisements

Rubber duck debugging is also known as rubberducking.

Techopedia Explains Rubber Duck Debugging

The idea behind rubber duck debugging is simple – by
explaining the process out loud, the programmer is able to better understand
the nature of the code, the purpose of individual lines or modules, and what code
is intended to do, in contrast to what it actually does. This idea is similar
to the idea of proofreaders reading text aloud in order to catch errors, or
mathematicians explaining an equation step by step in order to understand how
the process works.

With rubber duck debugging, the idea is dressed up in a
humorous way – the duck does not actually play any active role in the
process. Again, it is the idea of verbal explanation that helps the developer to
catch bugs in the code. For instance, the programmer could be “showing the duck”
how a loop aggregates a certain string variable, and realize that one of the
parameters is set wrong. Programmers can recognize fencepost errors and other
types of errors while they are verbally going through the code and explaining it
out loud. Rubber duck debugging has become somewhat commonly used term to
describe this kind of explicatory process and why it is valuable to IT pros.

Advertisements

Related Terms

Margaret Rouse
Editor

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…