<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>validates_presence_of :purpose : Tag pairing, everything about pairing</title>
    <link>http://lenaherrmann.net</link>
    <language>en_US</language>
    <ttl>40</ttl>
    <description>Lena Herrmann</description>
    <item>
      <title>Things I learned recently</title>
      <description>&lt;p&gt;Doing client work for &lt;a href="http://upstream-agile.com"&gt;Upstream&lt;/a&gt;, I recently had the pleasure of pair programming with fabulous &lt;a href="http://freelancing-gods.com"&gt;Pat Allan&lt;/a&gt; for a month. Here are a few of the things I learned.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    Pair Programming is a good thing (not that I haven't known that before). Here is &lt;a href="http://www.pathf.com/blogs/2009/09/pair-programming-york-times/"&gt;yet another good article about pairing&lt;/a&gt; if you aren't convinced yet. Next to improved concentration, keeping each other from getting stuck in stuff, I like the sharing of best practices, Textmate short cuts, syntax tricks etc.
  &lt;/li&gt;
  
  &lt;li&gt;
    Instead of writing "puts" in, after and before blocks that don't act as expected, use ruby-debug. It's really easy, and gives you so much more information about your situation.
    Just do:
&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;notextile&gt;&lt;span class="CodeRay"&gt;sudo gem install ruby-debug&lt;/span&gt;&lt;/notextile&gt;&lt;/pre&gt;&lt;/div&gt;      
And in your code, at the place you want to examine:
&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;notextile&gt;&lt;span class="CodeRay"&gt;require &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;ruby-debug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;
debugger&lt;/span&gt;&lt;/notextile&gt;&lt;/pre&gt;&lt;/div&gt;
    Then restart script/server with the --debug option. It stops when the line where you put 'debugger' is reached. You can directly call variables to explore their values. The basic commands are:
    &lt;ul class="second-level"&gt;
      &lt;li&gt;n - next&lt;/li&gt;
      &lt;li&gt;s - step into method&lt;/li&gt;
      &lt;li&gt;c - continue to breakpoint&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  


  &lt;li&gt;
    Read the source code of the gems you're using. If you are not sure how to do something with the gem, the actual code is often more informative than documentation. Lachie Cox &lt;a href="http://smartbomb.com.au/2008/02/i-love-me-some-source"&gt;describes in his blog&lt;/a&gt; how to set up a Textmate shortcut with which you can access all your gems without any typing. 
  &lt;/li&gt;

  &lt;li&gt;
    &lt;a href="http://www.rubular.com"&gt;Rubular&lt;/a&gt; is a nice app to test regular expressions in your browser.
  &lt;/li&gt;

  &lt;li&gt; 
    I have never used RCov before. Of course it doesn't mean too much, but having a test coverage of 97,7% feels good, I can tell you. A Code to Test Ratio of 1:2.7 is not bad either.
    &lt;br/&gt;
    The RCov gem has moved to &lt;a href="http://github.com/relevance/rcov"&gt;Relevance&lt;/a&gt;, &lt;a href="http://www.claytonlz.com/index.php/2009/04/how-to-setup-rspec-cucumber-webrat-rcov-and-autotest-on-leopard"&gt;read here&lt;/a&gt; how to set it up for an RSpec/Cucumber environment. 
  &lt;/li&gt;

  &lt;li&gt;
    And finally, I got convinced that it's good to have a blog ...
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here we are!&lt;/p&gt;

</description>
      <pubDate>Sat, 24 Oct 2009 21:12:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0934e5ce-393c-4b62-96f3-e14fe762114f</guid>
      <comments>http://lenaherrmann.net/2009/10/24/things-i-learned-recently#comments</comments>
      <category>ruby</category>
      <category>rails</category>
      <category>debugging</category>
      <category>pairing</category>
      <category>textmate</category>
      <category>testing</category>
      <trackback:ping>http://lenaherrmann.net/trackbacks?article_id=1</trackback:ping>
      <link>http://lenaherrmann.net/2009/10/24/things-i-learned-recently</link>
    </item>
  </channel>
</rss>
