From: Michal Suchanek Date: 2009-06-19T21:31:25+09:00 Subject: Re: Stepping Through Ruby 2009/6/18 John Wells : > On Sun, Jun 14, 2009 at 10:17 AM, Mike Stephens wrote: >> In VBA you can step through the code and at any point examine all the >> state. Is there any similar facility for Ruby? > > In addition to ruby-debug, Netbeans, RubyMine and Eclipse (via Aptana) > all provide this capability. > Perhaps I should install one of those and try them out? But seriously, I have not really longed for this feature recently. I sometimes use gdb for C code because it's harder to add debugging output there with all the recompilation and stuff. However, I have observed that machine instructions are apparently small enough that the principle of uncertainty known from the quantum theory applies. By observing your code with a debugger you may cause it to behave differently than how it behaves otherwise. These cases are quite rare but the more insidious are the resulting problems. In theory you write tests for your code and if fitting multiple pieces together fails you write more tests that cover more cases, perhaps ones that were uninteresting previously but became some sort of turning points when multiple pieces of code interact. As you might not see because I haven't published my code I have not written the tests so I ended up writing ad-hoc tests for cases that fail and debug those which is somewhat harder after the fact. Having the tests ready would certainly make it easier to understand how things fail, probably even more so than having a debugger. Thanks Michal