4 ms·
I used visual debuggers in college, Eclipse and Java. But then I found Ruby, and switched almost entirely from debugging to unit tests. Yes, they're not entirel
by steveklabnik 11y ago
I used visual debuggers in college, Eclipse and Java. But then I found Ruby, and switched almost entirely from debugging to unit tests. Yes, they're not entirely the same thing, but I had found that using a debugger meant I didn't write tests. Once I found and fixed the problem, done.
Once I started writing tons of tests, I found I didn't need the debugger as often. When your methods are less than ten lines, they're much easier to reason about, and a method becomes a pretty decent 'unit' to check out, no need to step through.
However, this also probably has to do with my relative skill levels and the languages and tools involved too. Ruby debugging has gotten better, but only in the last couple of years. And I didn't really know how to write tests nearly as well when I was doing Java.
- yoklov 11y agoI work in an area where unit testing is, generally speaking, more effort than its worth (game programming -- the state space is generally too huge for unit tests to be really practical). So I can't really comment on the effectiveness of them, other than to say that yes, they are different. Typically, instead of unit tests, I write state tracking and visualization code. This goes a long way towards helping track down bugs and keeping me out of the debugger, but honestly, a lot of that is just an indication of debugging tools being crap in general.