True Confesssions
Posted by Rick DeNatale Thu, 18 Oct 2007 14:52:00 GMT
Shhhh! I've got a confession. I've been known to use rdebugToday, my evil twin, Pat Mueller, posted an article alerting me to the fact that some rubyists seem to think that using a debugger is some kind of moral failing.
Pat took that belief to task, and I've got to agree.
Like all of you, my gentle readers, I'm perfect. I never make mistakes, so I never need a debugger. Well I thought that I made a mistake once, but discovered I was wrong!
Seriously, when I first encountered Ruby it was really lacking in debugger support. Although I missed a good debugger, I struggled along, and yes, I didn't miss it all that much. Why? Because a debugger has always been just one tool in my arsenal.
Most of the time I'm happy to write tests, see that the test fails, write code, make the test pass, lather, rinse and repeat. By taking small steps, I find that it usually goes rather well.
But, on the rare occasion, that fourth step poses problems, and that's when I pull out rdebug.
In fact it's usually: rdebug test/unit/someclass_test.rb although I run rails under rdebug from time to time.
Ruby IDEs like netbeans and aptana are now provide good integrated debugging. Pat mentions this, although he's not as hooked in to the ruby community as he should be, so I don't think he realizes that they are using rdebug through an ide interface wrapper.
Now using IDEs seems to be another moral failing by some luminaries estimation, but then again maybe not.
Personally, I've got nothing against a good IDE, Heck, I used to work with and on Smalltalk IDEs (VisualAge), and Java IDEs (VA/JAVA, VA MicroEdition, and Eclipse). But I've been almost as happy using VIM on Linux and now TextMate on OSX. There's even a TextMate bundle which talks to rdebug and let's you set breakpoints.
I don't use that much, but when I need it, I'm happy and unashamed.










Ya, I’m aware that NetBeans et al are piggy-backing their IDE-based debugger support on pre-existing debug support in the runtime. It’s obvious once you poke around the settings, READMEs, etc for the IDE itself. That’s the perfect story, actually. One low-level debug story that can serve multiple purposes.
Already dreaming of building my audible breakpoint hack from Smalltalk, in Ruby :-)
The Perl module Spreadsheet::WriteExcel has almost no tests, and it’s mostly a bunch of packed data structures. To port it, there were many times I was forced to start a Perl and Ruby debugger, run them side by side, and do line by line comparisons of the output.
That was a barrel of laughs, lemme tell ya, but it wouldn’t have been possible to port it without a debugger. :)
I blogged about Gyre, a Rails debugger built in Rails, several months ago. I blogged today a ghetto Rails debugger built out of RCov, Mongrel, and tests. People are over-reacting to this anti-debugger post in a big way.
I’m so tired of it.