Test often
How do we keep the number of bugs down in our programs?
Add code in chunks.
Make your program do one thing. Test it. Is it right?
If yes, add more code to do another thing.
Test it. Is it right?
Add more code to do another thing.
If you test it over and over, you'll find the bugs easier.
You know what's really hard?
Making an entire program, testing it at the end and then finding the bug. It could be anywhere!