You’re writing a computer programme, and you need to debug it. Why not use a rubber duck?
The concept was originally described in the book The Pragmatic Programmer: From Journeyman to Master. As with so many coding in-jokes, it has flourished on the web.