A Couple Lines To Improve Print-Based Debugging In Loops
There are a lot of simple ideas that float about in programming. Many that are conceptually simple, yet end up being a bit tricky for you to implement. Right until the moment you see how somebody else does it, and you have a more concrete feeling for the simplicity.
Source: A Couple Lines To Improve Print-Based Debugging In Loops, an article by Raphael Gaschignard.