From: Alexandru Popescu Date: 2006-07-06T20:07:52+09:00 Subject: Re: debugging proposal On 7/6/06, Joel VanderWerf wrote: > Max Muermann wrote: > > Hi everybody, > > > > First up, I'm new to this list and to Ruby. Let me express my gratitude > > to Matz (and others) for creating such a wonderful programming > > environment. I have only been playing with Ruby for about a week, and I > > have loved every minute of it. Just reading Ruby code makes me smile... > > > > However, there is one thing that is bugging (or rather debugging?) me, > > which is the lack of performant debugging support in the language. > > You're not going to like this response, but after ruby sinks in and gets > in your veins, this is how you debug: > > 1. refactor > > 2. unit test > > 3. write to stdout / stderr / log files > I haven't done too much real work on ruby yet, but I still believe this is a very bad suggestion. Ruby (and any programming language) is about productivity and in my whole experience (I have to agree that most of it is spent on Java) never a sout have been more productive than a debugging session (for enough complex stuff). ./alex -- .w( the_mindstorm )p. > 4. insert irb breakpoints (explicit method calls that drop into an irb > shell) > > 5. set up druby interface so you can control and query a process remotely > > I've almost never used debug.rb or trace.rb in 5.5 years of rubying, and > #4 and #5 rarely. That, after being addicted to the MSVC++ debugger. > Still, if there were a very nice, free, fast, GUI debugger for ruby, I'd > probably give it a spin. > > Anyway, enough with being flippant. Your breakpoint mechanism looks > interesting. It would be nice to connect to a running program with drb > and tell it to stop next time it hits some file/line, and then be able > to evaluate strings in the current binding. If we could do this with > only a small loss in performance (and no loss when no breakpoints are > enabled), I'd use it. > > -- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 > >