With many bugs (most, one would hope), a debugger is your best friend. You step through the code, make sure it’s doing what it’s supposed to, have it break on exceptions (just thrown or unhandled), skip around the code, check for variables at various