Aug 30, 2024
Depends what you are doing. If I am working on a smallish bit of code where I can run it and see the result in 2 seconds, I'll often build incrementally and run often. Often, writing unit tests as you go is a good way to do this.
Sometimes if it takes a lot of steps to get to the test point, for example in a complex GUI program, then that approach isn't practical. It is then worth checking the code to eliminate obvious errors before you spend several minutes clicking through to get to the point where your code gets to run.