Some programmers use a rubber duck method for debugging. It means that you put (or imagine putting) a toy duck on your working table and explain to it in much detail what the program is supposed to do. With the help of this method
the programmers are often able to find an error that remained unnoticed when the code was checked in programming environment.
You may have thought that programmers are all a bit nuts but to play with rubber ducks? Anyway, you must not be surprised to see a yellow toy duck on the working table of the most formidable and harsh programmer. A rubber duck is a loyal assistant of some developers. It is the first to learn how intricate symbols turn into a code. And it is the first to help find an error in this huddle.
Some programmers use a usual toy for debugging. This method known as “rubber duck debugging” was first made public in “The Pragmatic Programmer” written by Andrew Hunt and David Thomas. The joint work of two gifted programmers is intended to provide practical solutions of the problems, which developers often face when working on various tasks, starting with writing of the simplest code and ending with web design, etc.
The book contains some exact hints and templates. Applying them in their work, web designers can avoid frequent mistakes and find the required solutions. The already mentioned “rubber duck debugging” method has become especially popular. The point is to ask the toy any questions that emerge in the process of work.
These questions must have very exact wording and the duck should be asked as if it were a real human. The method principle consists in the statement that a question that is worded well already contains a part of its answer. In other words, to find the solution the task must be articulated. This method helps not only focus your attention but also systematize your thoughts and actions to some extent.
The same is required for debugging. Having found a problem in one part of a program, the developer must explain to the toy duck each line and describe its purpose in the program. This trick is successfully used by web design gurus when creating a web page. Such step-by-step explanation of actions helps find the correct answer. It is enough to address a usual rubber duck on your table.
By the way, the method of delegating tasks to an imaginary assistant has been borrowed and tested successfully by representatives of other intellectual occupations: from a blogger to a businessman. If you still have any questions or doubts, we suggest that you should watch a video straight from the horse’s, or more accurately, duck’s mouth.