On Tue, Sep 16, 2008 at 6:11 PM, Scott Taylor <[EMAIL PROTECTED]
> wrote:


> Yeah - I use a debugger all the time


I regard using the debugger as a bit of a smell. It often means my code
isn't clear enough to just bench-step through. In a way, it's like
commenting. Complicated code often needs comments and debugging. Code should
avoid being complicated.

I also have found myself relying on the debugger and print statements too
much, when a better approach is to take a step back and really ask myself
what the problems could be. It's so easy just to insert a breakpoint and
start examining variables, in the hopes that something will jump out at me.

All that said, I don't understand my coworkers who don't know how to use the
debugger (and who don't use my l() function). I've always said that in life,
there's the fast hard way and the slow easy way. Learning to use tools
effectively is the fast hard way. It takes effort, just like sharpening an
axe. But you end up cutting down a lot more trees.

The Smalltalk debugger, of course, is in a class by itself. When the
debugger comes across a missing method - say, because you wrote the test
before you wrote the method - it puts you - live! - in a skeleton of that
method, complete with the actual passed parameters. You fill in the guts and
continue on your way. Far too easy. No wonder it never caught on.

///ark
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to