Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

rubber ducking
debugging
psychology
bugs

What is rubber ducking?

Anusheh Zohair Mustafeez

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

If you ever come across a programmer in deep conversation with a rubber duck, do not be alarmed. They are probably just looking for bugs in their code with a popular debugging technique called rubber duck debugging.

Rubber duck debugging or rubber ducking for short, is a way of debugging code through explaining it to a rubber duck. The seemingly absurd technique originated from a story in The Pragmatic Programmer and is extremely useful.

Despite the name, rubber ducking can be done with any inanimate object.

Debugging can be a very toiling task. Logical errors like:

  • forgetting to call a function
  • using an incorrect logical operator
  • running an extra iteration in a for loop

These errors can be challenging to spot even after spending hours scanning a program. Rubber ducking allows a programmer to slow down and describe their code in the simplest way possible. By breaking their program down, programmers are able to have a new perspective that makes it easier to catch bugs they may have missed earlier and remove any junk code in their program.

RELATED TAGS

rubber ducking
debugging
psychology
bugs

CONTRIBUTOR

Anusheh Zohair Mustafeez
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring