<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Dahlia Bock</title>
	
	<link>http://www.dahliabock.com/blog</link>
	<description />
	<lastBuildDate>Mon, 11 Mar 2013 02:54:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dahliabock/UrCY" /><feedburner:info uri="dahliabock/urcy" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Standups are a waste of time</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/oiHZderESNM/</link>
		<comments>http://www.dahliabock.com/blog/2013/03/10/standups-are-a-waste-of-time/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 21:10:47 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[teamwork]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=590</guid>
		<description><![CDATA[A bold statement, I know. But get this, in the many teams and projects I&#8217;ve been on, the progression of realization always goes like this: Standup is at 9.00am &#8211;&#62; People can&#8217;t seem to get here on time for standup. It&#8217;s important, let&#8217;s all be more responsible &#8211;&#62; (People still &#8230; <a href="http://www.dahliabock.com/blog/2013/03/10/standups-are-a-waste-of-time/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A bold statement, I know.</p>
<p>But get this, in the many teams and projects I&#8217;ve been on, the progression of realization always goes like this:</p>
<p>Standup is at 9.00am &#8211;&gt; People can&#8217;t seem to get here on time for standup. It&#8217;s important, let&#8217;s all be more responsible &#8211;&gt; (People still roll in right before standup) Why can&#8217;t people make it to standup on time? (And by on time we don&#8217;t mean running in right when it is happening) Should we change the time? What can we do? &#8211;&gt; Standup is now at 9.30am &#8211;&gt; (People still roll in right before standup) &#8211;&gt; Standup is taking too long. We should keep our updates to only things that are relevant to the larger audience &#8211;&gt; Now that we have the team split into functional teams, why don&#8217;t we have separate standups? &#8211;&gt; (What people say at standup is still useless and irrelevant even in a smaller setting) &#8211;&gt; Back to Square One.</p>
<p>The original manifesto of standups has been to follow 3 questions:</p>
<ol>
<li><span style="line-height: 13px;">What did I accomplish yesterday?</span></li>
<li>What will I do today?</li>
<li>What obstacles are impeding my progress?</li>
</ol>
<p>This might seem like reasonable and fairly relevant things to say. But as smart as we think we humans are, <a href="http://youarenotsosmart.com/" target="_blank">we really aren&#8217;t.</a> And we trick ourselves into think that although this process has done good things for us thus far, it will continue doing the same. The main goal of standup is to disseminate important information amongst team members so they they know what the goals of each day should be. If we spend the first 15-30 minutes of the day rambling, what is the point of it?</p>
<p>Here&#8217;s a radical thought? What if we didn&#8217;t have standups? That would require people to talk to each other frequently, maybe also sit next to each other, and be more collaborative. It&#8217;s definitely harder in a larger team setting (i.e. &gt; 10-15 people) but we should always reevaluate process when it ceases to benefit us and requires a lot of time and effort to upkeep.</p>
<p><strong>&#8211; Edited Mar 10th 2013, 10.52pm</strong></p>
<p>Please don&#8217;t get me wrong, I&#8217;m not saying that standups are entirely useless, but that if utilized in the right way it <em>could </em>be useful, but if it isn&#8217;t working out we should think about what other things we can do instead of following process for the sake of it.</p>
<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/oiHZderESNM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2013/03/10/standups-are-a-waste-of-time/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2013/03/10/standups-are-a-waste-of-time/</feedburner:origLink></item>
		<item>
		<title>“I may be an average programmer, but I have excellent discipline”</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/KSjh_SL18e0/</link>
		<comments>http://www.dahliabock.com/blog/2013/02/13/i-may-be-an-average-programmer-but-i-have-excellent-discipline/#comments</comments>
		<pubDate>Wed, 13 Feb 2013 16:48:51 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[coding practices]]></category>
		<category><![CDATA[ramble]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=577</guid>
		<description><![CDATA[This quote is courtesy of @KentBeck but shared with me by @ScottMuc and I have been thinking long and hard about what kind of a programmer I am and which kinds I would most rather work with. If we were to simplify things considerably, there are 2 types of programmers; the ones &#8230; <a href="http://www.dahliabock.com/blog/2013/02/13/i-may-be-an-average-programmer-but-i-have-excellent-discipline/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This quote is courtesy of <a href="https://twitter.com/kentbeck" target="_blank">@KentBeck</a> but shared with me by <a href="https://twitter.com/scottmuc" target="_blank">@ScottMuc</a> and I have been thinking long and hard about what kind of a programmer I am and which kinds I would most rather work with.</p>
<p>If we were to simplify things considerably, there are 2 types of programmers; the ones who are really smart and the ones who aren&#8217;t. And unfortunately for the rest the world, there is more of the latter than the former. Though being smart is mostly innate, there are certain skills and habits that programmers can and should develop to make themselves more effective.</p>
<ol>
<li><span style="line-height: 14px;">Keeping the big picture in mind, be it the architecture of the product that you&#8217;re building and how the different pieces fit together to form a holistic ecosystem. Knowing and understanding this can help you make decisions however small they might be, i.e. fixing one bug while causing a regression failure is NOT ok.<br />
</span></li>
<li>Stop and read your code.</li>
<li>Always be thorough. Do what you have to do to make sure you&#8217;ve covered all your bases. Sure QAs are much better at exploratory testing, but that does not excuse you from writing enough tests to cover as many scenarios as you can manage. Though of course, writing tests for the sake of coverage is a no-no. Think real hard before you add more code (See #2 above).</li>
<li>Be aware of trade-offs. One solution might not be clearly better than the other, and one person isn&#8217;t right all the time.</li>
<li>Above all, listen. The best software comes from well-oiled teams where two-way communication happens between developer and QA and product owner and project manager and customer.</li>
</ol>
<p>I may not be the world&#8217;s greatest expert in Android development, or Rails, or the JVM etc, but I have excellent discipline in getting things done and learning from my mistakes.</p>
<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/KSjh_SL18e0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2013/02/13/i-may-be-an-average-programmer-but-i-have-excellent-discipline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2013/02/13/i-may-be-an-average-programmer-but-i-have-excellent-discipline/</feedburner:origLink></item>
		<item>
		<title>A team lead is NOT a tech lead</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/pEB9il-PuYs/</link>
		<comments>http://www.dahliabock.com/blog/2013/01/16/a-team-lead-is-not-a-tech-lead/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 04:15:48 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[ramble]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=566</guid>
		<description><![CDATA[&#60;tl;dr/&#62; The main difference is that a tech lead needs to spend time writing code. We can&#8217;t have them setting the technical direction of a project without knowing the code. If you find your tech lead being in more meetings than in front of a computer coding, run the other &#8230; <a href="http://www.dahliabock.com/blog/2013/01/16/a-team-lead-is-not-a-tech-lead/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>&lt;tl;dr/&gt;</p>
<p>The main difference is that a tech lead needs to spend time writing code. We can&#8217;t have them setting the technical direction of a project without knowing the code. If you find your tech lead being in more meetings than in front of a computer coding, <strong>run the other way</strong>.</p>
<p>&lt;expanded version/&gt;</p>
<p>I have a big problem when people appoint someone a Tech Lead but pile on Team Lead type responsibilities on them and leave no room for Tech Lead work. For example, sitting in meetings to come up with acceptance criteria for features, or communicating decisions from one team member to another, or better yet having meetings about &#8220;why have the resources underperformed, shit this is LATE&#8221;. (And I&#8217;m not saying that these responsibilities solely belong to one person, that is another topic of discussion altogether)</p>
<p>If you want to pile on those responsibilities on someone, please don&#8217;t call that person a Tech Lead because they are <strong>NOT</strong> providing technical leadership. A technical leader does exactly that, provide technical leadership. They keep the big picture of a project in mind, integration points, architecture, future maintainability and performance, how the code needs to evolve, mentor new members, and most importantly <strong>WRITE CODE</strong>. If they do not have time for that, then cease all peripheral activities until they do.</p>
<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/pEB9il-PuYs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2013/01/16/a-team-lead-is-not-a-tech-lead/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2013/01/16/a-team-lead-is-not-a-tech-lead/</feedburner:origLink></item>
		<item>
		<title>Android XMPP: Remove your connection listeners!</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/7BpgVLwy84Q/</link>
		<comments>http://www.dahliabock.com/blog/2012/06/25/android-xmpp-remove-your-listeners/#comments</comments>
		<pubDate>Tue, 26 Jun 2012 02:56:13 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=555</guid>
		<description><![CDATA[If you&#8217;re using v7 of the Android Smack library, and you&#8217;re adding connection listeners when a join/leave or create/destroy session happens: XmppConnectionListener connectionListener = new XmppConnectionListener&#40;listener, this&#41;; xmppConnection.addConnectionListener&#40;connectionListener&#41;; You have to remember to remove them manually. You would think that when you call the leave method in the MultiUserChat class, it &#8230; <a href="http://www.dahliabock.com/blog/2012/06/25/android-xmpp-remove-your-listeners/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re using v7 of the Android Smack library, and you&#8217;re adding connection listeners when a join/leave or create/destroy session happens:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">XmppConnectionListener connectionListener <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmppConnectionListener<span style="color: #009900;">&#40;</span>listener, <span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
xmppConnection.<span style="color: #006633;">addConnectionListener</span><span style="color: #009900;">&#40;</span>connectionListener<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>You <strong>have</strong> to remember to remove them manually. You would think that when you call the <code>leave</code> method in the <code>MultiUserChat</code> class, it would remove all listeners for you. Nope. It does however remove all participant listeners but seem to leave the connection listeners hanging.</p>
<p>Save a handle on the listeners that you create, and then remove them:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">xmppConnection.<span style="color: #006633;">removeConnectionListener</span><span style="color: #009900;">&#40;</span>connectionListener<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/7BpgVLwy84Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2012/06/25/android-xmpp-remove-your-listeners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2012/06/25/android-xmpp-remove-your-listeners/</feedburner:origLink></item>
		<item>
		<title>Layered teams and how to do it wrong</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/duJMnuzaO2o/</link>
		<comments>http://www.dahliabock.com/blog/2012/01/29/layered-teams-and-how-to-do-it-wrong/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 19:43:24 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[teamwork]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=551</guid>
		<description><![CDATA[I have previously expressed my disapproval of layered teams in the past, so I won&#8217;t do it again. (Who are we kidding&#8230;) Here&#8217;s a list of things you can do so that everything will go as smoothly wrong as possible: Limit communication between teams to the &#8216;leads&#8217;. Don&#8217;t encourage each &#8230; <a href="http://www.dahliabock.com/blog/2012/01/29/layered-teams-and-how-to-do-it-wrong/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I have previously <a title="Why I think layer teams are a bad idea" href="http://www.dahliabock.com/blog/2009/08/06/why-i-think-layer-teams-are-a-bad-idea/" target="_blank">expressed</a> my <a title="Making teamwork work" href="http://www.dahliabock.com/blog/2009/04/04/making-teamwork-work/" target="_blank">disapproval</a> of layered teams in the past, so I won&#8217;t do it again. (Who are we kidding&#8230;)</p>
<p>Here&#8217;s a list of things you can do so that everything will go as smoothly <em>wrong</em> as possible:</p>
<ol>
<li>Limit communication between teams to the &#8216;leads&#8217;. Don&#8217;t encourage each team member to learn how to collaborate with other teams without depending on their &#8216;lead&#8217;.</li>
<li>Allow each person to go off into a silo and develop something and declare that it is done without confirming that it is consumable by other teams.</li>
<li>Collaborate on API design? That&#8217;s absurd.</li>
<li>Make sure your team members don&#8217;t learn the domain and understand what they are building. This includes not talking to the business people (Refer to #1).</li>
<li>When actual communication is needed between teams and their leads aren&#8217;t around to facilitate the discussion, use a ticketing system as a starting point and direct all future communication there. Face-to-face conversations should be kept to a minimum because everything needs to be tracked and we can&#8217;t track real conversations.</li>
</ol>
<p>I think teamwork has just been redefined. Sigh.</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/duJMnuzaO2o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2012/01/29/layered-teams-and-how-to-do-it-wrong/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2012/01/29/layered-teams-and-how-to-do-it-wrong/</feedburner:origLink></item>
		<item>
		<title>ActiveRecord: Avoid N + 1 queries</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/lRFzXj2HN0s/</link>
		<comments>http://www.dahliabock.com/blog/2012/01/25/activerecord-n-1-queries-problem/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 13:58:05 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[active record]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=539</guid>
		<description><![CDATA[Ruby 1.8.7, Rails 2.3.8 I made a rookie mistake a few days ago but thanks to a colleague of mine who smacked me on the hand, I had a chance to correct it. Consider the following model: class Order &#38;lt; ActiveRecord::Base belongs_to :account end class Account &#38;lt; ActiveRecord::Base has_many :orders &#8230; <a href="http://www.dahliabock.com/blog/2012/01/25/activerecord-n-1-queries-problem/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>Ruby 1.8.7, Rails 2.3.8</em></p>
<p>I made a rookie mistake a few days ago but thanks to a colleague of mine who smacked me on the hand, I had a chance to correct it. Consider the following model:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Order <span style="color:#006600; font-weight:bold;">&amp;</span>lt; <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  belongs_to <span style="color:#ff3333; font-weight:bold;">:account</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Account <span style="color:#006600; font-weight:bold;">&amp;</span>lt; <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  has_many <span style="color:#ff3333; font-weight:bold;">:orders</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>If you are retrieving a group of accounts and accessing each of its orders, you would be encountering an N + 1 query problem. Meaning you would be firing 1 query to retrieve 1 account, and if that account has N orders, N + 1 queries would be executed.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">accounts = Account.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:all</span>, <span style="color:#ff3333; font-weight:bold;">:limit</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#006666;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
accounts.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>a<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> a.<span style="color:#9900CC;">orders</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>ActiveRecord uses <code>default_scope</code> to avoid the N + 1 situation.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Account <span style="color:#006600; font-weight:bold;">&amp;</span>lt; <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  default_scope :<span style="color:#9966CC; font-weight:bold;">include</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#ff3333; font-weight:bold;">:order</span>
  has_many <span style="color:#ff3333; font-weight:bold;">:orders</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>This will execute just 2 queries:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">&quot;accounts&quot;</span><span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">&quot;accounts&quot;</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">10</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">&quot;orders&quot;</span><span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">&quot;orders&quot;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">&quot;orders&quot;</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">&quot;account_id&quot;</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">7</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">9</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>The <code>:include</code> option can be used in a named scope as well. Long running queries are bad (of course), especially when you are dealing with tens of thousands of records.</p>
<p>Lesson well learnt (and remembered). Thanks Blake.</p>
<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/lRFzXj2HN0s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2012/01/25/activerecord-n-1-queries-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2012/01/25/activerecord-n-1-queries-problem/</feedburner:origLink></item>
		<item>
		<title>Inspiration for 2012</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/L-AcgoC5jTA/</link>
		<comments>http://www.dahliabock.com/blog/2011/12/30/inspiration-for-2012/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 04:48:02 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[ramble]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=536</guid>
		<description><![CDATA[I&#8217;ve always been a pragmatist. It has to be realistic before I decide to do something. I have to admit that I might have missed out on a lot along the pragmatic way but with all the responsibilities of life and family, I don&#8217;t think I will ever be able &#8230; <a href="http://www.dahliabock.com/blog/2011/12/30/inspiration-for-2012/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve always been a pragmatist. It has to be realistic before I decide to do something. I have to admit that I might have missed out on a lot along the pragmatic way but with all the responsibilities of life and family, I don&#8217;t think I will ever be able to let that side of me go.</p>
<p>I also want to be useful. I want to use my skills (whatever they might be) for the benefit of a life or two, and no, corporations don&#8217;t count.</p>
<p>In most cases, those two sides of me don&#8217;t mix very well because doing one might cause the neglect of the other. So in the last few months I&#8217;ve been searching for ideas on how to be pragmatic and useful at the same time. I haven&#8217;t thought of anything yet (not surprising) but I know that I should stretch the practical side of me this coming year.</p>
<p>As much as I prefer being comfortable, curve balls, come get me!</p>
<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/L-AcgoC5jTA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2011/12/30/inspiration-for-2012/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2011/12/30/inspiration-for-2012/</feedburner:origLink></item>
		<item>
		<title>ThoughtWorks University: Effective use of pairing as a coaching tool</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/tcX1FbATLfY/</link>
		<comments>http://www.dahliabock.com/blog/2011/10/12/thoughtworks-university-effective-use-of-pairing-as-a-coaching-tool/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 15:44:31 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[pairing]]></category>
		<category><![CDATA[ThoughtWorks]]></category>
		<category><![CDATA[twu]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=530</guid>
		<description><![CDATA[Part of the current format of ThoughtWorks University (TWU, the graduate training program at ThoughtWorks) is to place grads on a project to get their hands dirty and experience what it would be like to be on TW project with a real client. There have been debates about whether or &#8230; <a href="http://www.dahliabock.com/blog/2011/10/12/thoughtworks-university-effective-use-of-pairing-as-a-coaching-tool/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Part of the current format of ThoughtWorks University (TWU, the graduate training program at ThoughtWorks) is to place grads on a project to get their hands dirty and experience what it would be like to be on TW project with a real client. There have been debates about whether or not a project run at TWU is indicative of what a real TW project would be, one of the reasons being the ratio of experienced to inexperienced team members is really low, but we shall put those arguments aside for now.</p>
<p>As a trainer, one of my responsibilities is to pair with the grads on my team as I would&#8217;ve done on any other project. However, things are not as straightforward as just pairing because it involves other sub-responsibilities as well, e.g. assessing their technical skill levels, figuring out their problem solving techniques, understanding how best they learn and adjusting my coaching responses to them accordingly. Of the two terms of TWU that I worked with, we had an average of 5 grad developers to a trainer. Ideally, I would like to have at least 3-4 days of pairing time per grad, broken into 2-day slots where the former would be a chance for me to assess where they are at and how to form a customized coaching plan for them and the latter for them to have a chance for them to work on the feedback they received from the first pairing session (if any) or get more out of pairing with someone with more experience since that really is one of the main goals in the first place.</p>
<p>At 4 days per grad and 5 grads per trainer, that works out to be 20 days in total. With only 6 weeks per term, that doesn&#8217;t allow room for edge cases or other work that will take away time from pairing (surprisingly enough, there are lots of it).</p>
<p>What I think would be preferable is to have a 3-1 grad/trainer ratio and a smaller number of grads per group. I don&#8217;t think piling on more trainers to the mix will improve the situation as more people means more overhead. I would like to hear other TWU trainers&#8217; experiences related to this (apologies for this being very TW-specific) because circumstance seemed to have dictated that my 2 terms were (somewhat abnormally) large ones and I wished that things had been different.</p>
<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/tcX1FbATLfY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2011/10/12/thoughtworks-university-effective-use-of-pairing-as-a-coaching-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2011/10/12/thoughtworks-university-effective-use-of-pairing-as-a-coaching-tool/</feedburner:origLink></item>
		<item>
		<title>Grails: Speeding up dependency resolution</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/QDRli1GUE1U/</link>
		<comments>http://www.dahliabock.com/blog/2011/08/28/grails-speeding-up-dependency-resolution/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 13:13:39 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=526</guid>
		<description><![CDATA[Something you might want to consider doing in your project is to lock down specific version of your dependencies instead of getting the latest release. The dependencies closure in our BuildConfig.groovy used to look like this: dependencies &#123; test &#34;org.codehaus.geb:geb-core:latest.release&#34; test &#34;org.codehaus.geb:geb-spock:latest.release&#34; test &#34;org.seleniumhq.selenium:selenium-chrome-driver:latest.release&#34; test &#34;org.seleniumhq.selenium:selenium-firefox-driver:latest.release&#34; test &#34;org.seleniumhq.selenium:selenium-ie-driver:latest.release&#34; test &#34;org.spockframework:spock-core:0.5-groovy-1.7&#34; &#8230; <a href="http://www.dahliabock.com/blog/2011/08/28/grails-speeding-up-dependency-resolution/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Something you might want to consider doing in your project is to lock down specific version of your dependencies instead of getting the latest release. The dependencies closure in our BuildConfig.groovy used to look like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="groovy" style="font-family:monospace;">    dependencies <span style="color: #66cc66;">&#123;</span>
        test <span style="color: #ff0000;">&quot;org.codehaus.geb:geb-core:latest.release&quot;</span>
        test <span style="color: #ff0000;">&quot;org.codehaus.geb:geb-spock:latest.release&quot;</span>
        test <span style="color: #ff0000;">&quot;org.seleniumhq.selenium:selenium-chrome-driver:latest.release&quot;</span>
        test <span style="color: #ff0000;">&quot;org.seleniumhq.selenium:selenium-firefox-driver:latest.release&quot;</span>
        test <span style="color: #ff0000;">&quot;org.seleniumhq.selenium:selenium-ie-driver:latest.release&quot;</span>
        test <span style="color: #ff0000;">&quot;org.spockframework:spock-core:0.5-groovy-1.7&quot;</span>
    <span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Every script we ran took about 30-45 secs to resolve dependencies before it did anything, which was quite ridiculous. So after some digging around, <a href="https://github.com/barnardb" target="_blank">Ben</a> and I found out that if we specified the version of the plugins we wanted, that would drastically reduce the time spent resolving those dependencies.</p>
<p>This configuration shaved off about 20-35 seconds from our build:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="groovy" style="font-family:monospace;">    dependencies <span style="color: #66cc66;">&#123;</span>
        test <span style="color: #ff0000;">&quot;org.codehaus.geb:geb-core:0.6.0&quot;</span>
        test <span style="color: #ff0000;">&quot;org.codehaus.geb:geb-spock:0.6.0&quot;</span>
        test <span style="color: #ff0000;">&quot;org.seleniumhq.selenium:selenium-chrome-driver:2.4.0&quot;</span>
        test <span style="color: #ff0000;">&quot;org.seleniumhq.selenium:selenium-firefox-driver:2.4.0&quot;</span>
        test <span style="color: #ff0000;">&quot;org.seleniumhq.selenium:selenium-ie-driver:2.4.0&quot;</span>
        test <span style="color: #ff0000;">&quot;org.spockframework:spock-core:0.5-groovy-1.7&quot;</span>
    <span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/QDRli1GUE1U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2011/08/28/grails-speeding-up-dependency-resolution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2011/08/28/grails-speeding-up-dependency-resolution/</feedburner:origLink></item>
		<item>
		<title>Grails: Mocking domain classes in controller specs</title>
		<link>http://feedproxy.google.com/~r/dahliabock/UrCY/~3/likZ3ZIQztA/</link>
		<comments>http://www.dahliabock.com/blog/2011/08/27/grails-mocking-domain-classes-in-controller-specs/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 15:26:51 +0000</pubDate>
		<dc:creator>Dahlia</dc:creator>
				<category><![CDATA[grails]]></category>
		<category><![CDATA[mocking]]></category>

		<guid isPermaLink="false">http://www.dahliabock.com/blog/?p=510</guid>
		<description><![CDATA[I&#8217;ve been working in the Grails space for the last few months and after having done some work in Rails before, I&#8217;ve found Grails to be severely frustrating. One of the problems we faced when writing specs for our controllers is that the available testing frameworks (e.g. Spock) doesn&#8217;t really have &#8230; <a href="http://www.dahliabock.com/blog/2011/08/27/grails-mocking-domain-classes-in-controller-specs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working in the Grails space for the last few months and after having done some work in Rails before, I&#8217;ve found Grails to be severely frustrating. One of the problems we faced when writing specs for our controllers is that the available testing frameworks (e.g. Spock) doesn&#8217;t really have the capability to mock out all domain methods (instance and static) properly when they are called from within an <a href="http://grails.org/doc/latest/guide/5.%20Object%20Relational%20Mapping%20(GORM).html#5.5.1 Events and Auto Timestamping" target="_blank">event</a> (e.g. <code>beforeUpdate</code>, <code>beforeDelete</code>).</p>
<p>One way that <a href="https://github.com/barnardb" target="_blank">Ben</a> and I tried was to use Groovy&#8217;s metaClass to essentially mock out those methods that were called within the domain class events. For example, given the Contact domain class:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Contact <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">def</span> beforeUpdate <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span>
        someLocalMethod<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>And the ContactControllerSpec:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ContactControllerSpec <span style="color: #000000; font-weight: bold;">extends</span> ControllerSpec <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">def</span> <span style="color: #ff0000;">&quot;should update contact&quot;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        given:
        <span style="color: #000000; font-weight: bold;">def</span> contacts <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span><span style="color: #000000; font-weight: bold;">new</span> Contact<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;John Smith&quot;</span>, phone: <span style="color: #ff0000;">&quot;123456789&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
        mockDomain<span style="color: #66cc66;">&#40;</span>Contact, contacts<span style="color: #66cc66;">&#41;</span>
&nbsp;
        when:
        controller.<span style="color: #006600;">update</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
        then:
        ...
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>This test will throw an exception saying that it doesn&#8217;t recognize the call to</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="groovy" style="font-family:monospace;">someLocalMethod</pre></td></tr></table></div>

<p>So we had to mock it out:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="groovy" style="font-family:monospace;">registerMetaClass<span style="color: #66cc66;">&#40;</span>Contact<span style="color: #66cc66;">&#41;</span>
Contact.<span style="color: #006600;">metaClass</span>.<span style="color: #006600;">someLocalMethod</span> <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The call to</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="groovy" style="font-family:monospace;">registerMetaClass</pre></td></tr></table></div>

<p>ensures that any modifications you&#8217;ve made to the class gets cleaned up at the end of every test.</p>
<p>If someone else knows of a better way to do this, I&#8217;d would much appreciate some tips.</p>
<img src="http://feeds.feedburner.com/~r/dahliabock/UrCY/~4/likZ3ZIQztA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dahliabock.com/blog/2011/08/27/grails-mocking-domain-classes-in-controller-specs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.dahliabock.com/blog/2011/08/27/grails-mocking-domain-classes-in-controller-specs/</feedburner:origLink></item>
	</channel>
</rss>
