There’s a Ruby Debugger?
Wednesday, 31 October 2007
Posted by austin in: Ruby, Technology, trackback
Yeah. My post title is a little over the top, but since I started using Ruby in early 2002, I can’t count the number of times that I’ve used the Ruby debugger. After all, how does one count the empty set?
This is not to say that I haven’t had to debug; it’s to say that where tests haven’t sufficed in helping me specify behaviour correctly, Kernel#p has helped me find what did go wrong so that I could fix the problem and add a test (where appropriate; PDF::Writer, for example, has no tests).
So I think that Giles Bowkett is right, even though I’d say that debuggers aren’t harmful; they’re pointless in a pointerless language.
I find that I mostly use the debugger in C/C++/C# for stack traces in any case. It’s a bit less painful with a good IDE, but depending on the nature of the problem that I’m debugging (especially one in a tight loop), I will usually add print outputs to a log file and debug based on those logs. Yes, even when there’s pointers involved (because it’s usually a binary search approach where I figure out where a pointer went bad over a large run).




Comments
OK, having spent a lot of time and effort writing a Ruby debugger, I have to say I disagree ;-)
The point is that, to be useful, a debugger has to be fast, easy to use (visual beakpoints, simple step-into/over/call-stack navigation etc.) and have full ‘drill-down’ expansion). That’s what our debugger has – among other things. If you are used to debugging in C# you may want to try our Ruby debugger which is part of the Ruby In Steel IDE for Visual Studio ;-)
More info here:
http://www.sapphiresteel.com/Ruby-In-Steel-Developer-Overview
best wishes
Huw
I think it’s great that Ruby in Steel and NetBeans provide visual debuggers for Ruby, but I honestly haven’t had a need for a debugger in Ruby yet.
I also have to admit that I’ll probably never use Ruby in Steel because I despise every second I have to spend in Visual Studio for numerous reasons (I haven’t yet upgraded to Leopard, so I can’t say whether XCode has a good Ruby mode or whether I’d use it). When it comes to editing, I’m a hard-core vim guy.
Even in C++, I will spend most of my time using the binary-search
printfs approach rather than using Visual Studio, because it’s so painfully ugly. I only use the debugger when I already know where the problem is and I want to change values live while running.