title: Debugging Ruby/Python/Groovy
body: <p>I'm rephrasing this question because it was either too uninteresting or too incomprehensible. :)</p>
  
  <p>The original question came about because I'm making the transation from Java to Groovy, but the example could apply equally when transitioning to any of the higher-level languages (Ruby, Python, Groovy).</p>
  
  <p>Java is easy to debug because there is a clear relationship between lines of code, and fairly fine-grained behaviour, e.g. manipulate an array using a for loop:</p>
  
  <pre><code>for ( int i=0; i &lt; array1.size(); i++ )
  {
      if ( meetsSomeCriterion(array1.elementAt(i) )
      {
          array2.add( array1.elementAt(i) );
      }   
  }
  </code></pre>
  
  <p>so you can set a breakpoint on the test in the loop and see what happens next. (I know there are better ways to write this; it's just to illustrate the point.)</p>
  
  <p>In languages like Ruby the idiomatic style seems to favour higher-level one-liner coding, e.g. from <a href="http://rubyquiz.com/quiz113.html" rel="nofollow noreferrer">http://rubyquiz.com/quiz113.html</a></p>
  
  <pre><code>quiz.to_s.reverse.scan(/(?:\d*\.)?\d{1,3}-?/).join(',').reverse
  </code></pre>
  
  <p>I'm wondering if you can suggest any effective techniques for debugging this, for example if you changed the regular expression ... would you still use the traditional debugger, and step into/over the chained methods? Or is there a better way?</p>
  
  <p>Thanks!</p>