Desk Check — Unit 1#

You should not desk check all your methods. If the methods are simple enough to easily think your way through the process, then desk checking is unnecessary. So when should you use desk checking>

You should desk check if your method contains loops (for or while), especially if there are nested loops. Loops, especially loops with many variables or with a large number of iterations, can be very hard to track mentally. A desk check will make it easier to follow what happens inside the loop.

Desk checks are also useful when your program has a logic error and you can’t immediately identify it. If you program is running, but is not doing what you want it to do, then you have a logic error.