<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Technical &#34;craftsmanship&#34;</title>
	<atom:link href="http://allsharp.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://allsharp.wordpress.com</link>
	<description>Ways I improve my skill</description>
	<lastBuildDate>Mon, 29 Mar 2010 20:29:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='allsharp.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Technical &#34;craftsmanship&#34;</title>
		<link>http://allsharp.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://allsharp.wordpress.com/osd.xml" title="Technical &#34;craftsmanship&#34;" />
	<atom:link rel='hub' href='http://allsharp.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Bad code</title>
		<link>http://allsharp.wordpress.com/2010/03/29/bad-code/</link>
		<comments>http://allsharp.wordpress.com/2010/03/29/bad-code/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 20:29:03 +0000</pubDate>
		<dc:creator>allsharp</dc:creator>
				<category><![CDATA[Clean code]]></category>
		<category><![CDATA[R#]]></category>

		<guid isPermaLink="false">http://allsharp.wordpress.com/2010/03/29/bad-code/</guid>
		<description><![CDATA[Bad code &#8211; totally hate it. Except when it’s mine. Today i started working on the biggest project in my company. I’ve worked at it again in the past. It&#8217;s the best expression of legacy code. For me it’s a total blast. Bad code all around. And I love to swim in it. I really [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=30&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Bad code &#8211; totally hate it. Except when it’s mine. </p>
<p>Today i started working on the biggest project in my company. I’ve worked at it again in the past. It&#8217;s the best expression of legacy code. For me it’s a total blast. Bad code all around. And I love to swim in it.</p>
<p>I really like using R#’s “sharp” edge to slice through it. “Always true” expression? Redundant else? Unnecessary delegate construction? Bad format? Unused variable?</p>
<p>It’s quite amazing how much R# improved my and my colleagues code. When looking at the code of the past it’s incredible how dirty and filled with namespaces the code is.&#160; This has turned me into a code cleanup junky.</p>
<p>I also like to delete as much code as i can. I still don’t understand how a region could be of any help. Playing hide and seek with functionality? I especially enjoy deleting entire projects. It’s the “minor optimizations also count” side of me.</p>
<p>But lately this barely satisfies me. Now, to get really high i need at least a concept extracted into another class.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allsharp.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allsharp.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allsharp.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allsharp.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allsharp.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allsharp.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allsharp.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allsharp.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allsharp.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allsharp.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allsharp.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allsharp.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allsharp.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allsharp.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=30&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allsharp.wordpress.com/2010/03/29/bad-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb2b4b6d71641c71d0ad21179d7b6623?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">allsharp</media:title>
		</media:content>
	</item>
		<item>
		<title>Implicit vs. Explicit implementation</title>
		<link>http://allsharp.wordpress.com/2010/03/21/implicit-vs-explicit-implementation/</link>
		<comments>http://allsharp.wordpress.com/2010/03/21/implicit-vs-explicit-implementation/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 19:15:43 +0000</pubDate>
		<dc:creator>allsharp</dc:creator>
				<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://allsharp.wordpress.com/2010/03/21/implicit-vs-explicit-implementation/</guid>
		<description><![CDATA[We were discussing the other day at work about a certain situation. We had on a windows form some controls. One of them, representing currency, upon filling, should recompute one or more values also represented on the form. So given a currency the application layer would return some other fields. Very nice. But what about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=23&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We were discussing the other day at work about a certain situation. We had on a windows form some controls. One of them, representing currency, upon filling, should recompute one or more values also represented on the form.</p>
<p>So given a currency the application layer would return some other fields. Very nice. But what about an invalid currency. There is a cache in which available currencies are stored. If an invalid currency is provided the returned Currency type of object would be null.</p>
<p>Now the implicit part. Given a null currency the application layer would compute null fields. And that is excellent because that is one of the requirements. If the user enters an invalid currency the depending fields should be cleared. But is this good? We don’t have redundancy. But because of this you can’t really express the requirement in a unit test. That’s because given an invalid currency someone else really decides to clean the fields (by returning the null values). So the code looks really nice</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span><span class="kwrd">public</span> <span class="kwrd">void</span> OnCurrencyChanged(<span class="kwrd">string</span> currencyString)</pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre class="alt"><span class="lnum">   3:  </span>    Currency currency = currencyCache.GetFor(currencyString);</pre>
<pre><span class="lnum">   4:  </span>    InteresetAmount amnt = applicationLayer.GetInteresetFor(currency);</pre>
<pre class="alt"><span class="lnum">   5:  </span>    view.UpdateInterestAmountTo(amnt);</pre>
<pre><span class="lnum">   6:  </span>}</pre>
</div>
<p>Simple and clean, right?</p>
<p>But there is another issue with this, one more insidious. It is assumed that something happens in the application layer. I’m not sure if this is right though. I am counting on a HashTable to return a null object if the given key is not found in the dictionary, am i not? I think this is not really the same case. First of all we don’t have access to the code. It is framework code. MS would not change that code very soon because it would be a breaking change.</p>
<p>But some, given the right circumstances, might modify the application layer, so having a null Currency it would return a default interest amount. It sure sounds silly, but I’ve seen worse stuff. And right now I’ve just introduced a bug in the codebase. And it’s quite a nasty one. Tester might not find.</p>
<p>The latter, the explicit implementation translates to checking for null the currencyCache retrieved currency. If null explicitly clean the fields like:</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">public</span> <span class="kwrd">void</span> OnCurrencyChanged(<span class="kwrd">string</span> currencyString)</pre>
<pre>{</pre>
<pre class="alt">    Currency currency = currencyCache.GetFor(currencyString);</pre>
<pre>    <span class="kwrd">if</span>(currency==<span class="kwrd">null</span>)</pre>
<pre class="alt">    {</pre>
<pre>        CleanInterestAmount();</pre>
<pre class="alt">        <span class="kwrd">return</span>;</pre>
<pre>    }</pre>
<pre class="alt">    InteresetAmount amnt = applicationLayer.GetInteresetFor(currency);</pre>
<pre>    view.UpdateInterestAmountTo(amnt);</pre>
<pre class="alt">}</pre>
</div>
<p>I find this to be cleaner. Even if redundant in some way. And the test is also clear and well placed:</p>
<div class="csharpcode">
<pre class="alt">[TestFixture]</pre>
<pre><span class="kwrd">public</span> <span class="kwrd">class</span> When_user_enters_invalid_currency</pre>
<pre class="alt">{</pre>
<pre>    [Test]</pre>
<pre class="alt">    <span class="kwrd">public</span> <span class="kwrd">void</span> Should_clear_interest_amount()</pre>
<pre>    {</pre>
<pre class="alt">        var currencyString = <span class="str">"Invalid Currency"</span>;</pre>
<pre>        currencyCache.Stub(cc =&gt; cc.GetFor(currencyString)).Return(<span class="kwrd">null</span>);</pre>
<pre>        var sut = CreateSut();</pre>
<pre>        sut.OnCurrencyChanged(currencyString);</pre>
<pre>        view.AssertWasCalled(view=&gt; view.UpdateInterestAmountTo(<span class="kwrd">null</span>));</pre>
<pre class="alt">    }</pre>
<pre>}</pre>
</div>
<p>This is also the opinion of some stackoverflow folks.</p>
<p>Of course nothing comes for free. We get the nice test, and the explicit, revealing code. But we also get redundancy.</p>
<p>In conclusion, some redundancy might be good for your code after all?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allsharp.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allsharp.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allsharp.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=23&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allsharp.wordpress.com/2010/03/21/implicit-vs-explicit-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb2b4b6d71641c71d0ad21179d7b6623?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">allsharp</media:title>
		</media:content>
	</item>
		<item>
		<title>MVP, ohhh boy! Again?</title>
		<link>http://allsharp.wordpress.com/2010/03/19/mvp-ohhh-boy-again/</link>
		<comments>http://allsharp.wordpress.com/2010/03/19/mvp-ohhh-boy-again/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 09:50:11 +0000</pubDate>
		<dc:creator>allsharp</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[MVP]]></category>

		<guid isPermaLink="false">http://allsharp.wordpress.com/2010/03/19/mvp-ohhh-boy-again/</guid>
		<description><![CDATA[Me and my colleagues have started discussing quite a lot about different designs. Of course we got to the MVP pattern. It is pretty usual for a Novice/Advanced Beginner to look at patterns as recipes. I’m not saying that I might be Competent or even Proficient but under internal and most notably external forces i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=15&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Me and my colleagues have started discussing quite a lot about different designs. Of course we got to the <a href="http://martinfowler.com/eaaDev/ModelViewPresenter.html" target="_blank">MVP</a> pattern.</p>
<p>It is pretty usual for a Novice/<a href="http://en.wikipedia.org/wiki/Dreyfus_model_of_skill_acquisition" target="_blank">Advanced Beginner</a> to look at patterns as recipes. I’m not saying that I might be Competent or even Proficient but under internal and most notably external forces i started to look at patterns as better<strong>/</strong>best practices rather than mandatory recipes.</p>
<p>I find myself holding my point of view and some colleagues quoting <a href="http://martinfowler.com/" target="_blank">Martin Fowler</a> when discussing MVP. Of course I’ve read myself articles and books written by the great man. But from time to time you have to make your own road.</p>
<p>To the subject. Yesterday we were discussing a particular situation. We are trying to maintain presentation related logic in the Model (we are using <a href="http://martinfowler.com/eaaDev/PassiveScreen.html" target="_blank">Passive View</a>). We have a Currency field in the View and dependent upon the Currency field there are two other fields Interest Method and Interest Amount. So when the user modifies the Currency the other two fields get computed in the Model and reapplied to the View. So in the Presenter  we have something like:</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span><span class="kwrd">public</span> <span class="kwrd">class</span> Presenter</pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre class="alt"><span class="lnum">   3:  </span>    <span class="kwrd">public</span> <span class="kwrd">void</span> OnCurrencyChanged()</pre>
<pre><span class="lnum">   4:  </span>    {</pre>
<pre class="alt"><span class="lnum">   5:  </span>        Model.UpdateCurrencyTo(View.Currency);</pre>
<pre><span class="lnum">   6:  </span></pre>
<pre class="alt"><span class="lnum">   7:  </span>        View.InterestMethod = Model.InterestMethod;</pre>
<pre><span class="lnum">   8:  </span>        View.InterestAmount = Model.InterestAmount;</pre>
<pre class="alt"><span class="lnum">   9:  </span>    }</pre>
<pre><span class="lnum">  10:  </span>....</pre>
<pre class="alt"><span class="lnum">  11:  </span>....</pre>
<pre><span class="lnum">  12:  </span>}</pre>
<pre></pre>
<pre></pre>
<pre><a href="http://allsharp.files.wordpress.com/2010/03/image.png"><img style="display:inline;border:0;" title="image" src="http://allsharp.files.wordpress.com/2010/03/image_thumb.png?w=489&#038;h=287" border="0" alt="image" width="489" height="287" /></a></pre>
<pre></pre>
<p>Looking at this code one of our colleagues said that he didn’t like the look of it. We started discussing. A bit of flame was stirred. One colleague was going for <a href="http://martinfowler.com/eaaDev/PresentationModel.html" target="_blank">Presentation Model</a> . After almost 30 minutes of discussion it was clear what was wrong with the code. Inside the Model.UpdateCurrencyTo(View.Currency) the model would compute the dependent fields. After that the presenter would apply the computed fields to the view.</p>
<p>If you didn’t notice, this implies that the Presenter must know that the Model computes inside of UpdateCurrencyTo method the other two fields. But this is some tight coupling, isn’t it. Using the UpdateCurrencyTo to compute the fields means that we gain encapsulation of behavior. But the Presenter must know which fields are computed. So one hand we encapsulate on the other hand we must know what is encapsulated.</p>
<p>There are more solutions to this. We might use data binding between Model and View. But we are doing winforms on .net 2.0. You don’t have lambda expressions to do <a href="http://jagregory.com/writings/introduction-to-static-reflection/" target="_blank">static reflection</a> (for <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx" target="_blank">INotifyPropertyChanged</a> implementation). Instead of mapping specific fields from Model to View inside of the Presenter we might map all the fields on each call. But we got to the idea that the Model, inside UpdateCurrencyTo should update the right fields on the View.</p>
<p><img style="display:inline;border:0;" title="clip_image001[8]" src="http://allsharp.files.wordpress.com/2010/03/clip_image0018_thumb.gif?w=482&#038;h=346" border="0" alt="clip_image001[8]" width="482" height="346" /></p>
<p>This means that the fields that are modified inside of UpdateCurrencyTo remain encapsulated inside of the model. The methods called on the Presenter so that it updates the View contain the presentation behavior. If a view field needs to be disabled or marked as invalid the Presenter gets the chance to do that. So it maintains its main functionality.</p>
<p>I really like this solution. I find it very elegant. Probably because of its geometric shape. Of course in this solution the Model is pretty far of a <a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx" target="_blank">ViewModel</a>. But without proper data binding you are pretty limited.</p>
<p>The problem of building such a structure should not really raise any issues, right?</p>
<p>Unfortunately it got vetoed out. The pattern was too different from what is already done in the project. In my opinion that is one of it’s main points. It is different, and in the good way. Most probably that anything that is different from what we got in the project is better <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>The main issue is that we pretty much agreed that it is quite elegant and might work beautifully. But we are not professional enough to say that what we have is such bullshit that we must change it (we already kind of say this) and also go with it and make the change. Even if it is not a better solution. But i think at least the exploration and experimentation is worth it.</p>
<p>Excuses like “Martin Fowler says this and that”. But he’s not here. He doesn’t feel our pain…</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allsharp.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allsharp.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allsharp.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allsharp.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allsharp.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allsharp.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allsharp.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allsharp.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allsharp.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allsharp.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allsharp.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allsharp.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allsharp.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allsharp.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=15&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allsharp.wordpress.com/2010/03/19/mvp-ohhh-boy-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb2b4b6d71641c71d0ad21179d7b6623?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">allsharp</media:title>
		</media:content>

		<media:content url="http://allsharp.files.wordpress.com/2010/03/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://allsharp.files.wordpress.com/2010/03/clip_image0018_thumb.gif" medium="image">
			<media:title type="html">clip_image001[8]</media:title>
		</media:content>
	</item>
		<item>
		<title>R# live templates</title>
		<link>http://allsharp.wordpress.com/2010/02/03/r-live-templates/</link>
		<comments>http://allsharp.wordpress.com/2010/02/03/r-live-templates/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 10:00:24 +0000</pubDate>
		<dc:creator>allsharp</dc:creator>
				<category><![CDATA[R#]]></category>

		<guid isPermaLink="false">http://allsharp.wordpress.com/2010/02/03/r-live-templates/</guid>
		<description><![CDATA[As my last post might have revealed, I’m one lazy fellow. I hate moving my hands/fingers. So I guess it’s no surprise that I use R# quite a lot. A big part of my morning ritual is getting the latest build, viewing the changes and installing it. Just to be a bit closer to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=11&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As my last post might have revealed, I’m one lazy fellow. I hate moving my hands/fingers. So I guess it’s no surprise that I use R# quite a lot.</p>
<p>A big part of my morning ritual is getting the latest build, viewing the changes and installing it.</p>
<p>Just to be a bit closer to the edge I’ve created a pretty big list of R# live templates. Some I feel are outdated, and my laziness keeps me from bringing them up to date. But either way, some of you might find them helpful. </p>
<p>Some of them are quite simple like “dt”, which stands for “DateTime” and some are more complex like “tf” which stands for test fixture which generates a class marked with [TestFixture] that derives from the class in which we are. The classes name starts with “When_” and the test method inside of the test fixture starts with “Should_”. I’ve created all this templates at the time of my obsession with Context/Specification style of testing. I’m still at the <a href="http://en.wikipedia.org/wiki/Dreyfus_model_of_skill_acquisition" target="_blank">Advanced Beginner</a> level i like to think.</p>
<p>Also it is important to note that the live templates are created as “Mounted Storage” in R#.</p>
<p><a href="http://cid-07861c3eb398cc5a.skydrive.live.com/self.aspx/Blog Files/Resharper/LiveTemplatesStorage.xml" target="_blank">Live Template</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allsharp.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allsharp.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allsharp.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allsharp.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allsharp.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allsharp.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allsharp.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allsharp.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allsharp.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allsharp.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allsharp.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allsharp.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allsharp.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allsharp.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=11&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allsharp.wordpress.com/2010/02/03/r-live-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb2b4b6d71641c71d0ad21179d7b6623?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">allsharp</media:title>
		</media:content>
	</item>
		<item>
		<title>Stay on home row with Autohotkey</title>
		<link>http://allsharp.wordpress.com/2010/02/03/stay-on-home-row-with-autohotkey-2/</link>
		<comments>http://allsharp.wordpress.com/2010/02/03/stay-on-home-row-with-autohotkey-2/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:11:56 +0000</pubDate>
		<dc:creator>allsharp</dc:creator>
				<category><![CDATA[Autohotkey]]></category>

		<guid isPermaLink="false">http://allsharp.wordpress.com/2010/02/03/stay-on-home-row-with-autohotkey-2/</guid>
		<description><![CDATA[After reading the blog post of Jean-Paul S. Boodhoo (which apparently doesn&#8217;t work) I&#8217;ve realized that for a long I wanted to post my Autohotkey script that I called StayOnHomeRow.ahk. I can&#8217;t remember where i got the first version of it, because it sure was not my idea. But as I&#8217;m &#8220;always&#8221; trying to improve [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=4&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After reading the blog post of <a href="http://blog.jpboodhoo.com/ByeByeArrowKeys.aspx?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+JPBoodhoo+%28Jean-Paul+S.+Boodhoo%29">Jean-Paul S. Boodhoo</a> (which apparently doesn&#8217;t work) I&#8217;ve realized that for a long I wanted to post my Autohotkey script that I called StayOnHomeRow.ahk.</p>
<p>I can&#8217;t remember where i got the first version of it, because it sure was not my idea. But as I&#8217;m &#8220;always&#8221; trying to improve my speed of typing, and really liked the idea of vim but didn&#8217;t quite made it work with R#, I&#8217;ve created this script. Well, what it does? It does an amazing thing <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Jean-Paul Boodhoo&#8217;s posted script used the CapsLock key as the escape key which in conjunction with other keys allows him to stay on home row like this:</p>
<p>CAPS + E &#8211; Esc<br />
CAPS + J &#8211; Down Arrow<br />
CAPS + K &#8211; Up Arrow<br />
CAPS + L &#8211; Right Arrow<br />
CAPS + H &#8211; Left Arrow<br />
CAPS + F &#8211; Cycle forward through task switcher apps<br />
CAPS + D &#8211; Cycle backward through task switcher apps</p>
<p>Mine goes a bit further I think. It uses the left Alt key as the &#8220;escape key&#8221;. I know, it might not be the best option, but I found it is the one that I most easily can combine with other keys, on either side of the keyboard, but especially the right side. The right Alt key works the &#8220;old&#8221; way.</p>
<p>But I expanded it further like: Alt + Y, O are remapped to Ctrl+Left and Ctrl+Right&#8230; Alt+0 to F12, left Ctrl+0 to R# Find Results, Alt+Shift+0 to Alt+Shift+F12 (R# Go to usages of symbol) and many others&#8230;</p>
<p><a href="http://cid-07861c3eb398cc5a.skydrive.live.com/self.aspx/Blog Files/StayOnHomeRow.ahk" target="_blank">StayOnHomeRow.ahk</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allsharp.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allsharp.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allsharp.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allsharp.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allsharp.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allsharp.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allsharp.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allsharp.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allsharp.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allsharp.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allsharp.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allsharp.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allsharp.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allsharp.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=4&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allsharp.wordpress.com/2010/02/03/stay-on-home-row-with-autohotkey-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb2b4b6d71641c71d0ad21179d7b6623?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">allsharp</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://allsharp.wordpress.com/2010/02/03/hello-world/</link>
		<comments>http://allsharp.wordpress.com/2010/02/03/hello-world/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 08:51:33 +0000</pubDate>
		<dc:creator>allsharp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=1&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allsharp.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allsharp.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allsharp.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allsharp.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allsharp.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allsharp.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allsharp.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allsharp.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allsharp.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allsharp.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allsharp.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allsharp.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allsharp.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allsharp.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allsharp.wordpress.com&amp;blog=11820104&amp;post=1&amp;subd=allsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allsharp.wordpress.com/2010/02/03/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb2b4b6d71641c71d0ad21179d7b6623?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">allsharp</media:title>
		</media:content>
	</item>
	</channel>
</rss>
