<?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/"
	>

<channel>
	<title>Jonathan C Dickinson &#187; Short</title>
	<atom:link href="http://jonathan.dickinsons.co.za/blog/category/short/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathan.dickinsons.co.za/blog</link>
	<description>&#34;Jonathan Chayce Dickinson&#34;.ToString()</description>
	<lastBuildDate>Sun, 06 Jun 2010 11:07:31 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Code Contracts</title>
		<link>http://jonathan.dickinsons.co.za/blog/2010/01/code-contracts/</link>
		<comments>http://jonathan.dickinsons.co.za/blog/2010/01/code-contracts/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:38:34 +0000</pubDate>
		<dc:creator>Jonathan Dickinson</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Short]]></category>
		<category><![CDATA[XMPP Server 2010]]></category>

		<guid isPermaLink="false">http://jonathan.dickinsons.co.za/blog/?p=179</guid>
		<description><![CDATA[I recently started using CodeContracts and have a few tips.]]></description>
			<content:encoded><![CDATA[<p>I have recently started using the <a href="http://research.microsoft.com/en-us/projects/contracts/">Microsoft CodeContracts</a> on a large scale. These have been a fantastic addition to my toolset; because when I get the green flag on my code I know that I am <em>pretty</em> safe (it is beta, after all). I had to migrate quite a bit of code into the contracts and found that it can be quite a daunting task. A few things that I have picked up are:</p>
<ul>
<li>If you are migrating existing code and worrying only about contracts, switch off background checking. Firstly, this means that the results you get are comprehensive and secondly because of the build time you will think twice about hitting that build key again. Long builds == fewer builds == more time thinking == better code.</li>
<li>Use code snippets. The ones provided by Microsoft are great! Think about creating your own or changing them. For example cren and cresn no longer throw ArgumentExceptions for me; they are both ArgumentNullExceptions. I also have snippets like create contract class for (cc &#8211; scaffolding for ContractClassFor) and contract class implementation (cci &#8211; ContractClass attributation).</li>
<li>Invariants are your friend. Figure out what state a class should really be in and depend on that rather than Contract.Requires everywhere.</li>
<li>A well placed Contract.Ensures will save you a lot of grief.</li>
<li>Don&#8217;t loose hope. It may seem like it&#8217;s daunting at first &#8211; but as you start thinking in terms of contracts things become a lot faster. A single well-thought out Contract call will often clear off 5 warnings (for the bigger projects).</li>
<li>Some classes can be skipped ([ContractVerification(false)]) &#8211; especially if they are internal. Don&#8217;t gung-ho and try and get everything in contracts; because sometimes they may be ill-suited for the task (and you would by &#8216;lying&#8217; just to get the stuff to pass). These situations are few and far between; but they are there.</li>
<li>New development = contracts. Full stop.</li>
</ul>
<p>Overall I am finding fewer and fewer Contract failures during each build. This is mainly because CodeContracts is getting me into a better and more disciplined mindset. It&#8217;s a great tool and I highly recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathan.dickinsons.co.za/blog/2010/01/code-contracts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Direct to MSDN Chrome Search Tag</title>
		<link>http://jonathan.dickinsons.co.za/blog/2009/08/direct-to-msdn-chrome-search-tag/</link>
		<comments>http://jonathan.dickinsons.co.za/blog/2009/08/direct-to-msdn-chrome-search-tag/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 09:27:21 +0000</pubDate>
		<dc:creator>Jonathan Dickinson</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Short]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://jonathan.dickinsons.co.za/blog/2009/08/direct-to-msdn-chrome-search-tag/</guid>
		<description><![CDATA[lo-band and high-band views easy in chrome.]]></description>
			<content:encoded><![CDATA[<p>If you ever need to get directly to the documentation for a specific type in MSDN (which Bing routinely fails to give me) here is a search provider for Chrome that will do the trick:</p>
<pre class="brush: plain;">http://msdn.microsoft.com/en-us/library/%s.aspx</pre>
<p>You can obviously also do something like:</p>
<pre class="brush: plain;">http://msdn.microsoft.com/en-us/library/%s(loband).aspx</pre>
<p>In case you need a refresher, here is how you add it:</p>
<ol>
<li>Click the wrench (top right).</li>
<li>Options</li>
<li>Basics (top)</li>
<li>Manage (alongside “Default Search”)</li>
<li>Add</li>
<li>Give it a name and keyword (the keyword is important).</li>
<li>Paste in my URL.</li>
</ol>
<p>To use it go to your address bar and type the keyword, tab and then the full type name. So for example (my keyword was msdnd):</p>
<pre class="brush: plain;">msdnd : [TAB] : system.xml.serialization.xmlelementattribute : [RETURN]</pre>
]]></content:encoded>
			<wfw:commentRss>http://jonathan.dickinsons.co.za/blog/2009/08/direct-to-msdn-chrome-search-tag/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XLinQ Serialization</title>
		<link>http://jonathan.dickinsons.co.za/blog/2009/08/xlinq-serialization/</link>
		<comments>http://jonathan.dickinsons.co.za/blog/2009/08/xlinq-serialization/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 09:19:29 +0000</pubDate>
		<dc:creator>Jonathan Dickinson</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Short]]></category>

		<guid isPermaLink="false">http://jonathan.dickinsons.co.za/blog/2009/08/xlinq-serialization/</guid>
		<description><![CDATA[XmlSerializer suprisingly supports List<xelement>.</xelement>]]></description>
			<content:encoded><![CDATA[<p>Just found out that Microsoft actually had the foresight to support the following scenario:</p>
<pre class="brush: csharp;">/// &lt;summary&gt;
/// Gets the unknown elements as a &lt;see cref="List{XElement}"/&gt;.
/// &lt;/summary&gt;
[XmlAnyElement]
public List&lt;XElement&gt; UnknownElements
{
    get;
    set;
}</pre>
<p>Fantastic (undocumented) news.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathan.dickinsons.co.za/blog/2009/08/xlinq-serialization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
