<?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>Stefano Ricciardi</title>
	<atom:link href="http://stefanoricciardi.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefanoricciardi.com</link>
	<description>On Software Development and Thereabouts</description>
	<lastBuildDate>Thu, 01 Jul 2010 12:16:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Project Euler Problem 3 in F#</title>
		<link>http://stefanoricciardi.com/2010/07/01/project-euler-problem-3-in-f/</link>
		<comments>http://stefanoricciardi.com/2010/07/01/project-euler-problem-3-in-f/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 08:24:02 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[Euler Problems]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.com/?p=944</guid>
		<description><![CDATA[Continuing with my journey learning F# I have tackled Project Euler problem number 3, which asks: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 This problem deals with the fascinating problem of prime numbers factorization, which is considered a hard problem. So [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F07%2F01%2Fproject-euler-problem-3-in-f%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F07%2F01%2Fproject-euler-problem-3-in-f%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Continuing with my journey <a href="http://stefanoricciardi.com/2010/05/31/best-resources-to-learn-f/">learning F#</a> I have tackled <a href="http://projecteuler.net">Project Euler</a> problem number 3, which asks:</p>
<blockquote><p>The prime factors of 13195 are 5, 7, 13 and 29.</p>
<p>What is the largest prime factor of the number 600851475143</p></blockquote>
<p>This problem deals with the fascinating problem of <a href="http://en.wikipedia.org/wiki/Integer_factorization">prime numbers factorization</a>, which is considered a <em>hard</em> problem. So hard that our current cryptography schemes rely on this property.</p>
<p>This is my solution:</p>
<pre class="brush: fsharp">#light
open System.Numerics

let is_prime (x:BigInteger) =
    let rec check i =
        i &gt; x / 2I || (x % i &lt;&gt; 0I &amp;&amp; check (i + 1I))
    check 2I                 

let max_factor (n:BigInteger) =
    let factors = seq {
        let limit = float n |&gt; sqrt |&gt; int
        for i in 2I .. BigInteger(limit)  do
            if n % i = 0I &amp;&amp; is_prime i then yield i }
    Seq.max factors
</pre>
<p>A few comments:</p>
<ul>
<li>The first function (<code>is_prime</code>) is a simple <a href="http://en.wikipedia.org/wiki/Trial_division">trial division</a> to determine whether a given number is prime. There are cleverer algorithms to find prime numbers: see for example <a href="http://www.haskell.org/haskellwiki/Prime_numbers">here</a> For an interesting discussion you can also have a look at <i><a href="http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf">The Genuine Sieve of Erathostenes</a></i> by Melissa O&#8217;Neill.</li>
<li>The second function uses <a href="http://en.wikipedia.org/wiki/List_comprehension">comprehension</a> to create the list of primes which are factors for the input value. It can be demonstrated that it is enough to stop trial search at the square root of the number to be factorized. At the end we simply return the biggest factor.</li>
</ul>
<p>This code ran in about a second on my somewhat old 2005 desktop. It&#8217;s far from perfect, but it does the trick.</p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/Project-Euler-Problem-3-in-F-Stefano-Ricciardi"><img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F07%2F01%2Fproject-euler-problem-3-in-f%2F" style="border:0px"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/07/01/project-euler-problem-3-in-f/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Project Euler Problem 1 and 2 in F#</title>
		<link>http://stefanoricciardi.com/2010/06/14/project-euler-problem-1-and-2-in-f/</link>
		<comments>http://stefanoricciardi.com/2010/06/14/project-euler-problem-1-and-2-in-f/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 11:30:45 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[Euler Problems]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.com/?p=909</guid>
		<description><![CDATA[In my journey to learn F#, I have recently discovered the Project Euler site, which is a wonderful collection of small algorithmic problems which you can solve in your favorite programming language. This is the kind of excercise I needed to get my feet wet with F# after reading about it. So I started with [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F06%2F14%2Fproject-euler-problem-1-and-2-in-f%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F06%2F14%2Fproject-euler-problem-1-and-2-in-f%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In my journey to learn F#, I have recently discovered the <a href="http://projecteuler.net">Project Euler</a> site, which is a wonderful collection of small algorithmic problems which you can solve in your favorite programming language.</p>
<p>This is the kind of excercise I needed to get my feet wet with F# after reading about it. So I started with the first two problems listed on the site.</p>
<p>They both deal with sequence of numbers. Having a procedural/object-oriented mindset, I have scratched my head a few times in order to find a declarative solution true to the spirit of a functional program. Everything has become clearer after I&#8217;ve dug some more into the <a href="http://msdn.microsoft.com/en-us/library/dd233209.aspx">F# Sequences</a>.</p>
<h2>Problem 1</h2>
<blockquote><p>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.</p>
<p>Find the sum of all the multiples of 3 or 5 below 1000.</p></blockquote>
<p>This is my solution to it:</p>
<pre class="brush: fsharp">
# light
let test = 1
    |&gt; Seq.unfold (fun x -&gt; Some(x, x+1))
    |&gt; Seq.takeWhile (fun x -&gt; x &lt; 1000)
    |&gt; Seq.filter ( fun x -&gt; x % 3 = 0 || x % 5 = 0)
    |&gt; Seq.sum;;
</pre>
<h2>Problem 2</h2>
<blockquote><p>Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:</p>
<p>1, 2, 3, 5, 8, 13, 21, 34, 55, 89, &#8230;</p>
<p>Find the sum of all the even-valued terms in the sequence which do not exceed four million.</p></blockquote>
<p>Follows my solution:</p>
<pre class="brush:fsharp">
# light
let fibonacci_sequence = Seq.unfold (fun (a, b) -> Some(a, (b, a+b))) (0,1)
    |&gt; Seq.takeWhile(fun x -&gt; x &lt;= 400000)
    |&gt; Seq.filter(fun x -&gt; x % 2 = 0)
    |&gt; Seq.sum
</pre>
<p>A few comments:</p>
<ul>
<li>Here I am using the <code>filter</code> method defined on sequences to stop<br />
the sequence itself at 4 million, therefore I can get by with plain integers. Normally you would want to use <a href="http://msdn.microsoft.com/en-us/library/ee620695(v=VS.100).aspx">BigInteger</a>s for sequences where you&#8217;d expect to need handling large numbers.</li>
<li>One of my first attempts to this problem did not have the <code>Seq.filter</code> part. I only had the <code>takeWhile</code> like the following:</li>
<pre class="brush: fsharp">
Seq.takeWhile(fun x -&gt; x % 2 = 0 &amp;&amp; x &lt;= 400000)
</pre>
<p>Unfortunately, this does not work since the <code>takeWhile</code> will interrupt the sequence as soon as it satisfies the first condition (<code>x % 2 = 0</code>); in other words, it yields a sequence consisting only of the value 0, which looked somehow counterintuitive to me at first.
</ul>
<p>If you are also taking your first steps with F#, you might want to have a look to the <a href="http://stefanoricciardi.com/2010/05/31/best-resources-to-learn-f/">best resources to learn it</a>.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f06%2f14%2fproject-euler-problem-1-and-2-in-f%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f06%2f14%2fproject-euler-problem-1-and-2-in-f%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/Project-Euler-Problem-1-and-2-in-F-Stefano-Ricciardi"><img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F06%2F14%2Fproject-euler-problem-1-and-2-in-f%2F" style="border:0px"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/06/14/project-euler-problem-1-and-2-in-f/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Best Resources to Learn F#</title>
		<link>http://stefanoricciardi.com/2010/05/31/best-resources-to-learn-f/</link>
		<comments>http://stefanoricciardi.com/2010/05/31/best-resources-to-learn-f/#comments</comments>
		<pubDate>Mon, 31 May 2010 11:56:31 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[functional]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.com/?p=903</guid>
		<description><![CDATA[Have been hit by the functional programming bug yet? If you read around the blogsphere and listen to podcasts lately, you&#8217;ve surely been exposed to the revamp of functional programming languages all over the place. Haskell, Erlang, Clojure, F# will likely gain a fair share from the usual suspects (Java, C# in primis) at least [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F05%2F31%2Fbest-resources-to-learn-f%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F05%2F31%2Fbest-resources-to-learn-f%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Have been hit by the <a href="http://en.wikipedia.org/wiki/Functional_programming">functional programming</a> bug yet? If you read around the blogsphere and listen to podcasts lately, you&#8217;ve surely been exposed to the revamp of functional programming languages all over the place. Haskell, Erlang, Clojure, F# will likely gain a fair share from the usual suspects (Java, C# in primis) at least in some well defined areas of the business logic.</p>
<p>There are countless posts around highlighting what&#8217;s great (and not so great) about functional programming, so I won&#8217;t repeat those arguments here. What I am offering is just a few pointers to F# resources that might help you getting familiar with .NET way to functional programming.</p>
<h2>Screencasts</h2>
<p>Screencasts are a good way to get a feeling of what functional programming (and F# in particular) look like and why they should matter to you.</p>
<ul>
<li><a href="http://channel9.msdn.com/pdc2008/TL11/">An Introduction to Microsoft F#</a> by Luca Bolognese (PDC 2008). Excellent video, it takes a bit more than one hour.</li>
<li><a href="http://channel9.msdn.com/posts/martinesmann/Don-Syme-FSharp-and-functional-programming-in-NET/">F# and Functional Programming in .NET</a> (2009) by Don Syme (one of the fathers of the language). Another great video from the mind behind F#.</li>
</ul>
<h2>Free Documentation (Books, White Papers)</h2>
<p>When you are ready to get your feet wet with the languages, there are a few free resources that are great to get you started:</p>
<ul>
<li><a href="http://www.ctocorner.com/fsharp/book/">The F# Survival Guide</a>:</li>
<li><a href="http://en.wikibooks.org/wiki/Programming%3aF_Sharp">F# Programming</a>: from Wikibooks</li>
</ul>
<h2>Commercial Books</h2>
<p>Once I am ready to get serious about a language I feel a need a real book to get deeper into the details. Here are a few titles that seem to get great feedback from the community. A search with Google will reveal more and new titles are expected to be published shortly as the language is starting to get traction.</p>
<ul>
<li><a href="http://www.amazon.co.uk/gp/product/1590598504?ie=UTF8&amp;tag=stefaricci-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=1590598504">Expert F# Hardback (Expert&#8217;s Voice in .Net)</a><img style="margin: 0px; border-style: none !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=stefaricci-21&amp;l=as2&amp;o=2&amp;a=1590598504" border="0" alt="" width="1" height="1" />: This is the book I am using right now after going through the (shorter) free books above. <a href="http://blogs.msdn.com/b/dsyme/archive/2010/05/27/quot-expert-f-2-0-quot-on-its-way.aspx">A new version is about to be released</a>.</li>
<li><a href="http://www.amazon.co.uk/gp/product/1430223898?ie=UTF8&amp;tag=stefaricci-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=1430223898">Beginning F#</a><img style="margin: 0px; border-style: none !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=stefaricci-21&amp;l=as2&amp;o=2&amp;a=1430223898" border="0" alt="" width="1" height="1" /></li>
<li><a href="http://www.amazon.co.uk/gp/product/1933988924?ie=UTF8&amp;tag=stefaricci-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=1933988924">Real World Functional Programming: With Examples in F# and C#</a><img style="margin: 0px; border-style: none !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=stefaricci-21&amp;l=as2&amp;o=2&amp;a=1933988924" border="0" alt="" width="1" height="1" /></li>
</ul>
<h2>Other Web sites and Blogs</h2>
<ul>
<li><a href="http://http://msdn.microsoft.com/en-us/fsharp/default.aspx">Microsoft F# Developer Center</a>: Microsoft home page for all things F#, with tons of links and resources. That’s the place you want to go to download the tools and add-ins for Visual Studio 2008 if you, like me, haven’t switched to Visual 2010 yet.</li>
<li><a href="http://cs.hubfs.net/">Hubfs</a>: News, blogs and forums dedicated to the language.</li>
<li><a href="http://strangelights.com/FSharp/Wiki/Default.aspx">The FSharp Wiki</a>: Great collection of links to online resources.</li>
</ul>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f05%2f31%2fbest-resources-to-learn-f%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f05%2f31%2fbest-resources-to-learn-f%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/Best-Resources-to-Learn-F-Stefano-Ricciardi"><img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F05%2F31%2Fbest-resources-to-learn-f%2F" style="border:0px"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/05/31/best-resources-to-learn-f/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Fluent Builder in C#</title>
		<link>http://stefanoricciardi.com/2010/04/14/a-fluent-builder-in-c/</link>
		<comments>http://stefanoricciardi.com/2010/04/14/a-fluent-builder-in-c/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 20:27:40 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Design and Patterns]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.com/?p=884</guid>
		<description><![CDATA[When it comes to the number of arguments to pass to a function, Uncle Bob is pretty clear. Quoting from Clean Code: The ideal number of arguments for a function is zero (niladic). Next comes one (monadic), followed closely by two (dyadic). Three arguments (triadic) should be avoided when possible. More than three (polyadic) requires [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F04%2F14%2Fa-fluent-builder-in-c%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F04%2F14%2Fa-fluent-builder-in-c%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>When it comes to the number of arguments to pass to a function, <a href="http://www.objectmentor.com/omTeam/martin_r.html">Uncle Bob</a> is pretty clear. Quoting from <a href="http://www.amazon.co.uk/gp/product/0132350882?ie=UTF8&amp;tag=stefaricci-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0132350882">Clean Code</a><img style="margin: 0px; border-style: none !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=stefaricci-21&amp;l=as2&amp;o=2&amp;a=0132350882" border="0" alt="" width="1" height="1" />:</p>
<blockquote><p>The ideal number of arguments for a function is zero (niladic). Next comes one (monadic), followed closely by two (dyadic). Three arguments (triadic) should be avoided when possible. More than three (polyadic) requires very special justification – and then shouldn’t be used anyway.</p></blockquote>
<p>Still, some objects might have more than 3 attributes or properties and you usually need some way to initialize them via the constructor. Some attribute might not be mandatory, therefore on some occasions you can get by with a few overloads adding more parameters as needed.   </p>
<p>Consider the following (contrieved) example from the world of soccer. I have picked a few attributes that encapsulate the concept of a <code>Team</code>.</p>
<pre class="brush:csharp">
namespace Soccer
{
    public enum Color
    {
        White,
        Red,
        Green,
        Blue
    }

    public class Team
    {
        string Name { get; set; }
        string NickName { get; set; }
        Color ShirtColor { get; set; }
        string HomeTown { get; set; }
        string Ground { get; set; }

        public Team(
            string name,
            string nickName,
            Color shirtColor,
            string homeTown,
            string ground)
        {
            Name = name;
            NickName = nickName;
            ShirtColor = shirtColor;
            HomeTown = homeTown;
            Ground = ground;
        }
    }
}</pre>
<p>Let&#8217;s try initializing one team:</p>
<pre class="brush:csharp">Team team1 = new Team(
    "Manchester United",
    "The Red Devils",
    Color.Red,
    "Manchester",
    "Old Trafford");
</pre>
<p>In this case we are passing 5 arguments into the constructor. Consider that most of the parameters is a string, therefore it&#8217;s quite easy to get confused and invert the order of some parameter (the first two or the last two). The compiler would not be able to help in this case.</p>
<p>What may help here is a builder object with a <a href="http://en.wikipedia.org/wiki/Fluent_interface">fluent interface</a> which can help specifying all the attributes of the team. Something like the following:</p>
<pre class="brush:csharp">TeamBuilder tb = new TeamBuilder();
Team team2 =
    tb.CreateTeam("Real Madrid")
        .WithNickName("Los Merengues")
        .WithShirtColor(Color.White)
        .FromTown("Madrid")
        .PlayingAt("Santiago Bernabeu")
        .Build();
</pre>
<p>Let&#8217;s see the code for the <code>TeamBuilder</code> class:</p>
<pre class="brush:csharp">public class TeamBuilder
{
    private string name;
    private string nickName;
    private Color shirtColor;
    private string homeTown;
    private string ground;

    public TeamBuilder CreateTeam(string name)
    {
        this.name = name;
        return this;
    }

    public TeamBuilder WithNickName(string nickName)
    {
        this.nickName = nickName;
        return this;
    }

    public TeamBuilder WithShirtColor(Color shirtColor)
    {
        this.shirtColor = shirtColor;
        return this;
    }

    public TeamBuilder FromTown(string homeTown)
    {
        this.homeTown = homeTown;
        return this;
    }

    public TeamBuilder PlayingAt(string ground)
    {
        this.ground = ground;
        return this;
    }

    public Team Build()
    {
        return new Team(name, nickName, shirtColor, homeTown, ground);
    }
}
</pre>
<p>The only catch in the solution above is that the caller needs to call <code>Build()</code> at the end of the call chain.</p>
<p>We can improve the solution using an <a href="http://msdn.microsoft.com/en-us/library/z5z9kes2%28VS.71%29.aspx">implicit user-defined type conversion operator</a>:</p>
<pre class="brush:csharp">public class TeamBuilder
{
    private string name;
    private string nickName;
    private Color shirtColor;
    private string homeTown;
    private string ground;

    public TeamBuilder CreateTeam(string name)
    {
        this.name = name;
        return this;
    }

    public TeamBuilder WithNickName(string nickName)
    {
        this.nickName = nickName;
        return this;
    }

    public TeamBuilder WithShirtColor(Color shirtColor)
    {
        this.shirtColor = shirtColor;
        return this;
    }

    public TeamBuilder FromTown(string homeTown)
    {
        this.homeTown = homeTown;
        return this;
    }

    public TeamBuilder PlayingAt(string ground)
    {
        this.ground = ground;
        return this;
    }

    // CONVERSION OPERATOR
    public static implicit operator Team(TeamBuilder tb)
    {
        return new Team(
            tb.name,
            tb.nickName,
            tb.shirtColor,
            tb.homeTown,
            tb.ground);
    }
</pre>
<p>This allows you to create new teams in a more natural way as follows:</p>
<pre class="brush:csharp">TeamBuilder tb = new TeamBuilder();

Team team3 = tb.CreateTeam("Chelsea")
    .WithNickName("The blues")
    .WithShirtColor(Color.Blue)
    .FromTown("London")
    .PlayingAt("Stamford Bridge");
</pre>
<p>The above solution, albeit quite simple, is a good starting point. To make it ready for real-world code, you should making it more robust with some error checking (what happens if I omit some call from the chain? If I pass an invalid argument? Etc&#8230;).</p>
<p>More, you might want to hide the actual implementation from the clients and extract an interface or abstract class from the concrete <code>TeamBuilder</code>. This is left to the reader as an excercise <img src='http://stefanoricciardi.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://stefanoricciardi.com/2010/04/14/a-fluent-builder-in-c/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://stefanoricciardi.com/2010/04/14/a-fluent-builder-in-c/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p>    <a rev="vote-for" href="http://dotnetshoutout.com/Submit?url=http://stefanoricciardi.com/2010/04/14/a-fluent-builder-in-c/"><br />
        <img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http://stefanoricciardi.com/2010/04/14/a-fluent-builder-in-c/" style="border:0px"/><br />
    </a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/04/14/a-fluent-builder-in-c/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Book Review: Pragmatic Thinking And Learning</title>
		<link>http://stefanoricciardi.com/2010/04/05/book-review-pragmatic-thinking-and-learning/</link>
		<comments>http://stefanoricciardi.com/2010/04/05/book-review-pragmatic-thinking-and-learning/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 20:55:06 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.com/?p=875</guid>
		<description><![CDATA[Since you are reading this blog I assume that you are a software developer, or more in general a &#8220;knowledge worker&#8221; as Peter Drucker refers to the person “who puts to work what he has between his hears rather than the brawn of his muscles or the skill of his hands” in his excellent book [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F04%2F05%2Fbook-review-pragmatic-thinking-and-learning%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F04%2F05%2Fbook-review-pragmatic-thinking-and-learning%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.amazon.co.uk/Pragmatic-Thinking-Learning-Refactor-Programmers/dp/1934356050%3FSubscriptionId%3D0JTCV5ZMHMF7ZYTXGFR2%26tag%3Dstefaricci-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1934356050"><img style="margin: 0px 5px 0px 0px; display: inline;" src="http://ecx.images-amazon.com/images/I/51xArZnegaL._SL160_.jpg" alt="" align="left" /></a></p>
<p>Since you are reading this blog I assume that you are a software developer, or more in general a <em>&#8220;knowledge worker&#8221;</em> as <a href="http://en.wikipedia.org/wiki/Peter_Drucker">Peter Drucker</a> refers to the person <em>“who puts to work what he has between his hears rather than the brawn of his muscles or the skill of his hands”</em> in his excellent book <a href="http://www.amazon.co.uk/Effective-Executive-Peter-F-Drucker/dp/0434209503%3FSubscriptionId%3D0JTCV5ZMHMF7ZYTXGFR2%26tag%3Dstefaricci-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0434209503">Effective Executive</a>.</p>
<p>And if you try to keep up to date by reading books, blogs, listening to podcasts, etc&#8230; I sure don&#8217;t have to tell you how difficult it is staying on top of new technologies, frameworks, languages which come out quicker and quicker. It’s sure impossible to keep up with everything.</p>
<p>Trying to come up with some new ideas on how tackle this issue, I have picked up the book <a href="http://www.amazon.co.uk/Pragmatic-Thinking-Learning-Refactor-Programmers/dp/1934356050%3FSubscriptionId%3D0JTCV5ZMHMF7ZYTXGFR2%26tag%3Dstefaricci-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1934356050">Pragmatic Thinking and Learning: Refactor Your Wetware</a> by <a class="zem_slink" title="Andy Hunt (author)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Andy_Hunt_%28author%29">Andy Hunt</a> with high expectations, having loved <a href="http://www.amazon.co.uk/Pragmatic-Programmer-Andrew-Hunt/dp/020161622X%3FSubscriptionId%3D0JTCV5ZMHMF7ZYTXGFR2%26tag%3Dstefaricci-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D020161622X">The Pragmatic Programmer</a> (see my review of that book <a href="http://stefanoricciardi.com/2009/11/09/book-review-the-pragmatic-programmer/">here</a>) where Andy Hunt was one of the two authors. And I must say that I have not been disappointed: Pragmatic Thinking and Learning is another great book.</p>
<p>Let’s have a quick look to the contents.</p>
<h2>From Novice To Expert</h2>
<p>The book first focuses on describing a few phases one goes through in his learning journey. The Dreyfus brothers have tried to formalize the steps to reach the expert status on a given skill (like practicing a sport or programming using a particular language) in the following way:</p>
<ul>
<li><strong>Novice</strong>: you start from here and for basically everything you have to do you need a &#8220;recipe&#8221;.</li>
<li><strong>Advance Beginner</strong>: you now start trying things on your own, and need <em>reference</em> documentation (think of a list of API)</li>
<li><strong>Competent</strong>: you have more <em>initiative</em>, can troubleshoot existing problems and solve new ones.</li>
<li><strong>Proficient</strong>: at this stage you are more self-conscious of your own skill and want to understand the larger picture. This feedback is vital for your continuous improvement.</li>
<li><strong>Expert</strong>: at this stage you keep looking for better ways of doing things. You tend to work from <em>intuition</em> as opposed to a fixed set of rules and reason: you just ten to &#8220;feel&#8221; what&#8217;s right in any given situation.</li>
</ul>
<h2>How Your Brain Works and How To Make The Best Use of It</h2>
<p>The model put forward of your brain here is that of a &#8220;dual core&#8221; CPU. But the two halves don&#8217;t work the same way:</p>
<ul>
<li><strong>L-Mode</strong>: this is your <em>linear</em> mode(traditionally associated with the left hemisphere): analytical, rational, verbal. This is perhaps the part of our brain that we are most familiar with in our day-to-day activities as software developers.</li>
<li><strong>R-Mode</strong>: intuitive, analogic, non-rational. These are the traits most commonly associated with artists.</li>
</ul>
<p>This major section of the book explains why, as a knowledge worker, you need <em>both</em> modes to fully exploit your abilities, and gives tips on how to &#8220;shut up&#8221; the L-Mode for a while so that you can engage more the R-mode.</p>
<p>It then goes on to help you &#8220;debug&#8221; your thinking process, introducing several cognitive biases (things such as &#8220;self serving bias&#8221;, &#8220;hawthorne effect&#8221;, &#8220;false memory&#8221;) and explains that many of your hard-coded thought patterns might just be due to the generation you belong to (are you in the <a class="zem_slink" title="Baby Boom Generation" rel="wikipedia" href="http://en.wikipedia.org/wiki/Baby_Boom_Generation">Baby Boom Generation</a>, in the <a href="http://en.wikipedia.org/wiki/Generation_X">Generation-X</a> or in the <a class="zem_slink" title="Generation Y" rel="wikipedia" href="http://en.wikipedia.org/wiki/Generation_Y">Millennial Generation</a>?).</p>
<h2>Learn to Learn and Gain Experience</h2>
<p>The book then concentrates on the best practices to learn:</p>
<ol>
<li>You need to set <a href="http://www.projectsmart.co.uk/smart-goals.html">SMART</a> objectives for what you want to reach. Having a plan will keep you focused.</li>
<li>You need to consider your skills as a knowledge portfolio. You need to diversify the areas you decide to invest in and dedicate some quality time to it regularly (which requires planning some time in advance: trying to find some <em>free hours </em>here and there simply doesn’t work…).</li>
<li>You need to discover how you learn best. Do you prefer books and videos (visual) or podcasts (audio)? Consider joining a study group,</li>
<li>Use advanced learning techniques such as <a href="http://en.wikipedia.org/wiki/SQ3R" target="_blank">SQ3R</a>, or <a href="http://en.wikipedia.org/wiki/Mind_Mapping" target="_blank">mind mapping</a>. Teach to others.</li>
<li>We learn best by doing: explore, play (= have fun) with the concepts, gets your hand dirty. Experiment and don’t be afraid to make mistakes, possibly in a non-stressful situation (you don’t want to have the pressure of a “real” work project).</li>
</ol>
<h2>Keep the Focus</h2>
<p>The last part of the book has is somehow lighter and it’s dedicated to ways to increase your focus and attention. The author touches upon different topics from meditation to productivity tricks: if you have been exposed to productivity blogs such as <a href="http://lifehacker.com/">Lifehacker</a> you are like to be familiar with most of these already</p>
<h2>Conclusions</h2>
<p>This has really been a fun book to read and I whole-heartedly recommend it. I have gone back to it quite a few times already after reading it from cover to cover.</p>
<p>Each small chapter contains a “Next Actions” section with exercises and goals for you to try out and throughout the book there are tons of references if you are interested in a particular topic and want to dig more.</p>
<p>It used to be that all you needed to perform your job was “The C Programming Language”. That’s not the case any more.</p>
<blockquote><p>If I had eight hours to cut down a tree, I’d spend six hours sharpening my ax. &#8212; Abraham Lincoln.</p></blockquote>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="float: right; border-style: none;" src="http://img.zemanta.com/pixy.gif?x-id=c4e653b7-1ab6-4d42-a231-4f4d02bbbcf1" alt="" /></div>
<div class="wlWriterHeaderFooter" style="margin: 0px; padding: 0px 0px 0px 0px;">
<div class="shoutIt"><a rev="vote-for" href="http://dotnetshoutout.com/Submit?url=http://stefanoricciardi.com/2010/04/05/book-review-pragmatic-thinking-and-learning/&amp;title=Book+Review%3a+Pragmatic+Thinking+And+Learning"><img style="border: 0px;" src="http://dotnetshoutout.com/image.axd?url=http://stefanoricciardi.com/2010/04/05/book-review-pragmatic-thinking-and-learning/" alt="Shout it" /></a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/04/05/book-review-pragmatic-thinking-and-learning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comparing Floating Point Numbers</title>
		<link>http://stefanoricciardi.com/2010/03/02/comparing-floating-point-numbers/</link>
		<comments>http://stefanoricciardi.com/2010/03/02/comparing-floating-point-numbers/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 13:29:00 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.wordpress.com/?p=807</guid>
		<description><![CDATA[Floating Points and Rounding Errors. Working with floating points number can sometimes provide some (un)pleasant surprise, since many real numbers do not have a finite representation and this can lead to rounding errors. If you need to refresh your knowledge (and have some time to spare), you can find a great treatment in the article [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F03%2F02%2Fcomparing-floating-point-numbers%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F03%2F02%2Fcomparing-floating-point-numbers%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h2>Floating Points and Rounding Errors.</h2>
<p>Working with floating points number can sometimes provide some (un)pleasant surprise, since many real numbers do not have a finite representation and this can lead to rounding errors. </p>
<p>If you need to refresh your knowledge (and have some time to spare), you can find a great treatment in the article <a href="http://docs.sun.com/source/806-3568/ncg_goldberg.html">What Every Computer Scientist Should Know About Floating-Point Arithmetic</a>:</p>
<blockquote><p>
Squeezing infinitely many real numbers into a finite number of bits requires an approximate representation. Although there are infinitely many integers, in most programs the result of integer computations can be stored in 32 bits. In contrast, given any fixed number of bits, most calculations with real numbers will produce quantities that cannot be exactly represented using that many bits. Therefore the result of a floating-point calculation must often be rounded in order to fit back into its finite representation. This rounding error is the characteristic feature of floating-point computation.
</p></blockquote>
<p>A small example should make the problem clearly visible:</p>
<pre class="brush:csharp">
class Program
{
    static void Main(string[] args)
    {
        double a = 22.4;
        double b = a / 131;

        double c = 0;
        for (int i = 0; i < 131; i++)
        {
            c += b;
        }

        Console.WriteLine("Are they equal?: {0}", a == c);
        Console.WriteLine("Difference (a - c) is {0} ", a - c);
    }
}
</pre>
<p>Here we are taking a double (a), diving it by 131 and then creating a new number (c) by adding the result of that division 131 times. By pure math, a and c should be equal. If you try this small program yourself, this is the output that you would get:</p>
<pre>
Are they equal?: False
Difference (a - c) is -4,9737991503207E-14
</pre>
<p>As you can see, the result is not what you might expect, and it's affected by a rounding error that is building up every time b is added to the partial result c.</p>
<p>Note that this is dependent on the number that I have chosen. If you substitute 131 with 5, you will not experience this problem.</p>
<h2>Your Own Comparer</h2>
<p>Sometimes this behavior might annoy you, especially when you don't need such a high precision and a “rough” equality is all you need. A typical situation is unit testing an algorithm against some expected result: your assertions may fail because of a rounding error, even though the logic of your algorithm is formally correct.</p>
<p>In such a case, you might want to implement your own comparer. A desirable property for such a comparer is a threshold value: if the difference between two floating points is <em>below</em> that threshold they are considered equal.</p>
<p>All you need is to implement the .NET interface <code><a href="http://msdn.microsoft.com/en-us/library/ms132151.aspx">IEqualityComparer</a></code><a href="http://msdn.microsoft.com/en-us/library/ms132151.aspx"> </a>interface.</p>
<pre class="brush:csharp">
class DoubleComparer : IEqualityComparer
{
    private readonly double threshold;

    public DoubleComparer(double threshold)
    {
        this.threshold = threshold;
    }

    public bool Equals(double x, double y)
    {
        return Math.Abs(x - y) < this.threshold;
    }

    public int GetHashCode(double obj)
    {
       return obj.GetHashCode();
    }
}
</pre>
<p>I have created my own comparer to use in my unit tests. I only have to implement 2 methods: <code>Equals()</code> and <code>GetHashCode()</code>.</p>
<p>I don't care much for the actual algorithm of the hashcode implementation, so I am reusing <code>double</code> own algorithm.</p>
<p>Instead, I have applied my own logic to the Equals method: to me, two doubles are equal if the absolute value of their difference is within a given threshold (which I can pass to the comparer in the constructor).</p>
<h2>The Comparer In Use</h2>
<p>Suppose I have an algorithm to calculate the histogram of a given collection of doubles, and a unit test to validate the calculation against a collection of expected results.</p>
<p>In the example below, <em>samples</em> are the input values which I want to create the histogram for, and <em>expectedBreaks</em> is a sequence containing the left and right limits of the bins of the histogram (in the example I am requiring 5 bins, so the number of breaks is 5 + 1 = 6).</p>
<pre class="brush:csharp">
var p = new HistogramProvider();
double[] samples = { 20, 12, 4, 22, 19, 24, 9, 5, -12.2, 13, 0 };
double[] expectedBreaks = { -12.2, -4.96, 2.28, 9.52, 16.76, 24 };

var histogram = p.CreateHistogram(samples, 5);

Assert.IsTrue(expectedBreaks.SequenceEqual<double>(
                       histogram.Breaks,
                       new DoubleComparer(0.01)));
</pre>
<p>I have figured out the threshold to pass (0.01) based on the relative size of the doubles under analysis. Of course, you should use your own judgement to come up with a sensible threshold according of the range of your input data.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f03%2f02%2fcomparing-floating-point-numbers%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f03%2f02%2fcomparing-floating-point-numbers%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/Comparing-Floating-Point-Numbers"><img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F03%2F02%2Fcomparing-floating-point-numbers%2F"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/03/02/comparing-floating-point-numbers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Generics With Type Uknown At Compile Time</title>
		<link>http://stefanoricciardi.com/2010/02/18/generics-with-type-uknown-at-compile-time/</link>
		<comments>http://stefanoricciardi.com/2010/02/18/generics-with-type-uknown-at-compile-time/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 20:32:20 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[generics]]></category>
		<category><![CDATA[reflection]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.com/?p=773</guid>
		<description><![CDATA[The following is an example of a service containing both generic method calls and generic types. public interface IContainer&#60;T&#62; { IEnumerable&#60;IProperty&#60;T&#62;&#62; Properties { get; } } public interface IPropertyService { IContainer&#60;T&#62; GetProperties&#60;T&#62;(string propertyCode); } Now suppose that you don&#8217;t know the actual type of the data until runtime (possibly because the type is retrieved from [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F02%2F18%2Fgenerics-with-type-uknown-at-compile-time%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F02%2F18%2Fgenerics-with-type-uknown-at-compile-time%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The following is an example of a service containing both generic method calls and generic types.</p>
<pre class="brush:csharp">
public interface IContainer&lt;T&gt;
{
    IEnumerable&lt;IProperty&lt;T&gt;&gt; Properties { get; }
}

public interface IPropertyService
{
    IContainer&lt;T&gt; GetProperties&lt;T&gt;(string propertyCode);
}
</pre>
<p>Now suppose that you don&#8217;t know the actual type of the data until runtime (possibly because the type is retrieved from a DB or from some other service). You need a way to interact with these generics, and <a href="http://msdn.microsoft.com/en-us/library/system.reflection.aspx">Reflection </a>can help you here.</p>
<p>Let&#8217;s assume that you have managed to get the <code>Type</code> of the data that you are handling (such as <code>string</code>, <code>decimal</code>, <code>double</code>, etc&#8230;) and that you have a concrete implementation of the <code>IPropertyService</code> (perhaps through Dependency Injection).</p>
<p>Once you have that, you can invoke the <code>GetProperty</code> method in the following way:</p>
<pre class="brush:csharp">
Type type = // ... this is the actual runtime type
IPropertyService service = // ... this is an instance of the service

Type serviceType = typeof(IPropertyService);
MethodInfo getPropertiesInfo =
    serviceType.GetMethod(&quot;GetProperties&quot;, new Type[] { typeof(string) });

if (getPropertiesInfo == null)
{
    // Uh-oh.... has the interface changed after we wrote this? Throw an exception...
}

Type[] genericArguments = { type }; // we only have one generic argument (&lt;t&gt;)
MethodInfo getPropertiesMethodInfo =
    getPropertiesInfo.MakeGenericMethod(genericArguments);

// Finally invoke the method to search for a price
var propertiesContainer =
    getPropertiesMethodInfo.Invoke(service, new object[] { &quot;price&quot; });
</pre>
<p>As you can see are quite a few steps to be performed, but at the end, through reflection, you end up with a container filled with all the objects that you have required.</p>
<p>Now assume that you want to access to the single properties contained in the IContainer. You need some way to invoke the C# property <code>Properties</code>. defined on <code>IContainer</code>. Similarly to the <a href="http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.aspx">MethodInfo</a> class, System.Reflection has a <a href="http://msdn.microsoft.com/en-us/library/system.reflection.propertyinfo.aspx">PropertyInfo </a>class that you can use to work with Properties.</p>
<p>The following solution, despite compiling fine, will not work at run-time:</p>
<pre class="brush:csharp">
PropertyInfo containerInfo = typeof(IContainer&lt;&gt;).GetProperty(&quot;Properties&quot;); // WRONG!!!
if (containerInfo == null)
{
    // the interface has changed. Throw an exception
}

var properties = containerInfo.GetValue(container, null) as IEnumerable;
</pre>
<p>If you try to run this, you will be greeted by the following exception: <em>Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.</em></p>
<p>After scratching my head for a while, I realized that I should have first created a generic type at run-time before retrieving the <code>PropertyInfo</code>:</p>
<pre class="brush:csharp">
Type containerType = typeof(IContainer&lt;&gt;).MakeGenericType(type);
PropertyInfo containerInfo = containerType.GetProperty(&quot;Properties&quot;);
if (containerInfo == null)
{
    // the interface has changed. Throw an exception
}

var properties = containerInfo.GetValue(container, null) as IEnumerable;
</pre>
<p>At this point I have a collection of <code>IProperties</code> which I can enumerate through. If needed, since the types in this collection are also generic, I need to repeat the process above until I reach a fundamental type (such as <code>string</code>, <code>double</code>, etc&#8230;).</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f02%2f18%2fgenerics-with-type-uknown-at-compile-time%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f02%2f18%2fgenerics-with-type-uknown-at-compile-time%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/Generics-With-Type-Uknown-At-Compile-Time-Stefano-Ricciardis-Blog"><img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F02%2F18%2Fgenerics-with-type-uknown-at-compile-time%2F"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/02/18/generics-with-type-uknown-at-compile-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Podcasts For .NET Developers</title>
		<link>http://stefanoricciardi.com/2010/02/06/top-podcasts-for-net-developers/</link>
		<comments>http://stefanoricciardi.com/2010/02/06/top-podcasts-for-net-developers/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 18:02:43 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[learning review podcast]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.wordpress.com/?p=742</guid>
		<description><![CDATA[Why Should You Care About Podcasts There are many ways to keep up to date to what’s going on in the software community. Blogs, books, magazines, conferences, discussion groups, mailing lists, you name it… So, should you care about podcasts? If you are anything like most of us mere mortals, you’ve already come to realize [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F02%2F06%2Ftop-podcasts-for-net-developers%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F02%2F06%2Ftop-podcasts-for-net-developers%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h2>Why Should You Care About Podcasts</h2>
<p>There are many ways to keep up to date to what’s going on in the software community. Blogs, books, magazines, conferences, discussion groups, mailing lists, you name it… So, should you care about podcasts?</p>
<p>If you are anything like most of us mere mortals, you’ve already come to realize that there are way too many things that you would like learn and only so many hours in a day. Podcasts allow you to squeeze some more &#8220;learning time&#8221; from an otherwise compressed schedule.</p>
<p>I especially love to listen to podcasts on my running sessions. On the other end, I have found that I don&#8217;t usually care for them while commuting to and from work: I need some time to relax listening to good music before and after a stressful day. Your mileage might vary.</p>
<p>The podcasts listed below are basically the only one which I am subscribed to on iTunes. I can&#8217;t keep up with all the shows, so I try to cherry pick from the themes that are closer to my day to day work, occasionally listening to topics I am not familiar with just to see what&#8217;s going on.</p>
<p>A few other podcasts did not make my selection, like <a href="http://elegantcode.com/category/codecast/">Elegant Code</a> or <a href="http://itc.conversationsnetwork.org/series/stackoverflow.html">Stackoverflow</a>: after listening to a few episodes I found that they simply were not my cup of tea.</p>
<p>I especially love shows which have a clear focus, the right amount of &#8220;small talk&#8221;, and where the host(s) have a good understaing of the subject matter. Again, YMMV.</p>
<p><span id="more-742"></span></p>
<h2>05 &#8211; Deep Fried Bytes</h2>
<p><a href="http://deepfriedbytes.com/"><img style="display:inline;border-width:0;margin:0 5px 0 0;" title="DeepFriedBytes.2" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/deepfriedbytes-21.jpg" border="0" alt="DeepFriedBytes.2" width="104" height="45" /></a></p>
<p>At number 5 we have Deep Fried Bytes, hosted by <a href="http://keithelder.net/blog/" target="_blank">Keith Elder</a> and <a href="http://blog.cloudsocket.com/">Chris Woodruff</a>. The schedule is not strict, roughly one or two shows per month. Too bad because the content, almost exclusively on Microsoft technologies, tends to be top notch.</p>
<p>Favorite Eposide: <a href="http://deepfriedbytes.com/podcast/episode-35-why-comments-are-evil-and-pair-programming-with-corey-haines/">Episode 35: Why Comments Are Evil and Pair Programming With Corey Haines.</a></p>
<table border="0" cellspacing="0" cellpadding="0" width="239">
<tbody>
<tr>
<td width="135" valign="top">Content:</td>
<td width="102" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c5.gif"><img style="display:inline;border-width:0;" title="amazonstar4C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c_thumb5.gif" border="0" alt="amazonstar4C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="135" valign="top">Signal-to-noise ratio:</td>
<td width="102" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c1.gif"><img style="display:inline;border-width:0;" title="amazonstar3C" src="http://stefanoricciardi.files.wordpress.com/2010/02/amazonstar3c_thumb1.gif" border="0" alt="amazonstar3C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="135" valign="top">Frequency:</td>
<td width="102" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar2c.gif"><img style="display:inline;border-width:0;" title="amazonstar2C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar2c_thumb.gif" border="0" alt="amazonstar2C" width="64" height="12" /></a></td>
</tr>
</tbody>
</table>
<h2>04 &#8211; Hanselminutes</h2>
<p><a href="http://www.hanselminutes.com/"><img style="display:inline;border-width:0;margin:0;" title="hanselminutes" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/hanselminutes1.jpg" border="0" alt="hanselminutes" width="104" height="104" /></a></p>
<p>At number 4 we find Hanselminutes, the podcast of the famous Microsoft <span style="text-decoration:line-through;">developer</span> geek <a href="http://www.scotthanselman.com">Scott Hanselman</a>. If you don&#8217;t know him, he&#8217;s the name behind one of the most followed <a href="http://www.scotthanselman.com">blog</a> for develpers.</p>
<p>His shows tend to be on the short side (usually around 30 minutes), but they are usually really focused. He&#8217;ll usually talk about .NET technologies.</p>
<p>Once in a while you can lift your spirit with one episode of the <em>Hanselminutiae</em> series, which are more unstructured and tend to be a conversation about nerdish stuff and gadgets with some geek guest.</p>
<p>Favorite episode: <a href="http://www.hanselminutes.com/default.aspx?showID=168">Uncle Bob Martin: SOLID, this time with feeling.</a></p>
<table border="0" cellspacing="0" cellpadding="0" width="239">
<tbody>
<tr>
<td width="139" valign="top">Content:</td>
<td width="98" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c1.gif"><img style="display:inline;border-width:0;" title="amazonstar4C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c_thumb1.gif" border="0" alt="amazonstar4C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="139" valign="top">Signal-to-noise ratio:</td>
<td width="98" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c2.gif"><img style="display:inline;border-width:0;" title="amazonstar4C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c_thumb2.gif" border="0" alt="amazonstar4C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="139" valign="top">Frequency:</td>
<td width="98" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c3.gif"><img style="display:inline;border-width:0;" title="amazonstar3C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c_thumb3.gif" border="0" alt="amazonstar3C" width="64" height="12" /></a></td>
</tr>
</tbody>
</table>
<h2>03 &#8211; Herding Code</h2>
<p><a href="http://herdingcode.com/"><img style="display:inline;border-width:0;margin:0;" title="herdingCode-165px" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/herdingcode165px1.png" border="0" alt="herdingCode-165px" width="104" height="104" /></a></p>
<p>At number 3 we have Herding Code, hosted by <a href="http://odetocode.com/blogs/scott/">K. Scott Allen</a>, <a href="http://weblogs.asp.net/kdente/">Kevin Dente</a>, <a href="http://www.lazycoder.com/weblog/">Scott Koon</a>, and <a href="http://weblogs.asp.net/jgalloway/">Jon Galloway</a>. Four hosts tend to produce a slightly lower signal to noise ratio compared to other podcasts, but the content is usually well worth it. Again, you&#8217;ll mostly hear about Microsoft technologies here.</p>
<p>Favorite episode: <a href="http://herdingcode.com/?p=189">Herding Code 51: Greg Young on Our Grand Failure – Thoughts on DDDD</a></p>
<table border="0" cellspacing="0" cellpadding="0" width="239">
<tbody>
<tr>
<td width="137" valign="top">Content:</td>
<td width="100" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c.gif"><img style="display:inline;border-width:0;" title="amazonstar4C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c_thumb.gif" border="0" alt="amazonstar4C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="137" valign="top">Signal-to-noise ratio:</td>
<td width="100" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c2.gif"><img style="display:inline;border-width:0;" title="amazonstar3C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c_thumb2.gif" border="0" alt="amazonstar3C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="137" valign="top">Frequency:</td>
<td width="100" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c3.gif"><img style="display:inline;border-width:0;" title="amazonstar3C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c_thumb3.gif" border="0" alt="amazonstar3C" width="64" height="12" /></a></td>
</tr>
</tbody>
</table>
<h2>02 &#8211; DotNet Rocks</h2>
<p><a href="http://www.dotnetrocks.com/"><img style="display:inline;border-width:0;margin:0;" title="DotNetRocks" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/dotnetrocks1.jpg" border="0" alt="DotNetRocks" width="104" height="103" /></a></p>
<p>At number 2 we find what&#8217;s arguably the best and longest running podcast on .NET technologies. <a href="http://www.dotnetrocks.com/">DotNetRocks</a>, hosted by Carl Franklin and Richard Campbell and now at his 523 eposide, usually issues a new show twice a week.</p>
<p>At the beginning of every new show, there&#8217;s a short section (a couple of minutes or so) named &#8220;Better Know Framework&#8221; in which they &#8220;shine some light &#8220;on some class of the .NET Base Class Library.</p>
<p>If you have time for only one podcast and don&#8217;t care for other technologies/platforms, then this is probably the podcast you should be listening to.</p>
<p>Favorite episode: <a href="http://www.dotnetrocks.com/default.aspx?showNum=476">Panel: Is Software Development Too Complex?</a></p>
<table border="0" cellspacing="0" cellpadding="0" width="209">
<tbody>
<tr>
<td width="137" valign="top">Content:</td>
<td width="70" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c3.gif"><img style="display:inline;border-width:0;" title="amazonstar4C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c_thumb3.gif" border="0" alt="amazonstar4C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="137" valign="top">Signal-to-noise ratio:</td>
<td width="70" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c4.gif"><img style="display:inline;border-width:0;" title="amazonstar4C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar4c_thumb4.gif" border="0" alt="amazonstar4C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="137" valign="top">Frequency:</td>
<td width="70" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar5c.gif"><img style="display:inline;border-width:0;" title="amazonstar5C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar5c_thumb.gif" border="0" alt="amazonstar5C" width="64" height="12" /></a></td>
</tr>
</tbody>
</table>
<h2>01 &#8211; Software Engineering Radio</h2>
<p><a href="http://www.se-radio.net/"><img style="display:inline;border-width:0;margin:0;" title="SoftwareEngineeringRadio" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/softwareengineeringradio1.jpg" border="0" alt="SoftwareEngineeringRadio" width="104" height="104" /></a></p>
<p>At the top of my list we have a podcast that is <em>not</em> devoted to .NET technologies.</p>
<p><a href="http://www.se-radio.net/">Software Engineering Radio</a>, usually hosted by <a href="http://www.voelter.de/">Markus Völter</a>, is your 10,000 feet view on what&#8217;s going on in the software industry: new languages, patterns, processes. And evergreen topics like OOAD, components, architecture, etc&#8230;</p>
<p>The shows are usually extremely focused on the topic to be discussed, and Markus shows a remarkable easiness moving from one subject to another. He surely prepares a lot before the shows; his questions to the guest are usually spot-on and he has a way of rephrasing the concepts exposed by the experts that really helps your understanding.</p>
<p>The show has a fortnight frequency, therefore I usually don&#8217;t miss a single show. I actually downloaded a lot of old episodes: since they are not so strictly connected with current-day technologies, they usually stand the test of time pretty well.</p>
<p>As an added plus, a show usually last about 1 hour which is perfect for my workout sessions <img src='http://stefanoricciardi.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Favorite episode: <a href="http://www.se-radio.net/podcast/2009-11/episode-150-software-craftsmanship-bob-martin">Software Craftsmanship With Bob Martin</a></p>
<table border="0" cellspacing="0" cellpadding="0" width="239">
<tbody>
<tr>
<td width="135" valign="top">Content:</td>
<td width="102" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar5c1.gif"><img style="display:inline;border-width:0;" title="amazonstar5C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar5c_thumb1.gif" border="0" alt="amazonstar5C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="135" valign="top">Signal-to-noise ratio:</td>
<td width="102" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar5c2.gif"><img style="display:inline;border-width:0;" title="amazonstar5C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar5c_thumb2.gif" border="0" alt="amazonstar5C" width="64" height="12" /></a></td>
</tr>
<tr>
<td width="135" valign="top">Frequency:</td>
<td width="102" valign="top"><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c3.gif"><img style="display:inline;border-width:0;" title="amazonstar3C" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/02/amazonstar3c_thumb3.gif" border="0" alt="amazonstar3C" width="64" height="12" /></a><strong> </strong></td>
</tr>
</tbody>
</table>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f02%2f06%2ftop-podcasts-for-net-developers%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f02%2f06%2ftop-podcasts-for-net-developers%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/Top-Podcasts-For-NET-Developers-Stefano-Ricciardis-Blog"><img src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F02%2F06%2Ftop-podcasts-for-net-developers%2F" alt="Shout it" /></a></p>
<p><!-- AddThis Button BEGIN --></p>
<p><a href="http://www.addthis.com/bookmark.php?v=250"><img style="border-width:0;" src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="Bookmark and Share" width="125" height="16" /></a></p>
<p><!-- AddThis Button END --></p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e6ceeafa-fe5c-4bd6-a48d-325da43e5abc" class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Programming">Programming</a>,<a rel="tag" href="http://technorati.com/tags/C%23">C#</a>,<a rel="tag" href="http://technorati.com/tags/podcast">Podcast</a></div>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/02/06/top-podcasts-for-net-developers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>See Your XML Docs As You Type With CR Documentor</title>
		<link>http://stefanoricciardi.com/2010/01/22/see-your-xml-docs-as-you-type-with-cr-documentor/</link>
		<comments>http://stefanoricciardi.com/2010/01/22/see-your-xml-docs-as-you-type-with-cr-documentor/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 19:39:29 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Documentor]]></category>
		<category><![CDATA[Ghost-Doc]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.wordpress.com/?p=701</guid>
		<description><![CDATA[Introduction Almost 10 years ago now I used to be a Java developer in Motorola. After a long hiatus in the embedded systems and a job change, I have come back to enterprise development, this time in .Net. I remembered that in the good ol’ days it required 2 steps to see the final rendering [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F22%2Fsee-your-xml-docs-as-you-type-with-cr-documentor%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F22%2Fsee-your-xml-docs-as-you-type-with-cr-documentor%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Introduction</h3>
<p>Almost 10 years ago now I used to be a Java developer in Motorola. After a long hiatus in the embedded systems and a job change, I have come back to enterprise development, this time in .Net.</p>
<p>I remembered that in the good ol’ days it required 2 steps to see the final rendering of the XML documentation: firing javadoc (usually from within an ANT task) and the open up the content in a browser.</p>
<p>I was quite surprised to see that in the .Net area seeing the final output of the docs was not as straightforward as I hoped for. Yes, there was <a href="http://ndoc.sourceforge.net/">NDoc</a> to parse the XML, but its development stopped around 2005 and it’s doesn’t support anything beyond C# 2.0. There’s also <a href="http://www.codeplex.com/Sandcastle">Sandcastle</a>, but to make it work for me it has required a few downloads and a bit of tweaking here and there. And integrating it into my NAnt task had not been that easy either. But somehow in the end I have pulled that out.</p>
<p>Therefore I have been pleasantly surprised when I met <strong>CR Documentor, </strong>a little plug-in for visual studio that let’s you see your XML documentation <em>as you write it</em>. It’s almost like having a WYSIWYG editor, without having to launch Sandcastle, wait for the complete build, and open up the browser.</p>
<h3>Installation</h3>
<ul>
<li><a href="http://code.google.com/p/cr-documentor/"><img style="display:inline;border-width:0;margin:0;" title="cr_documentor-logo" src="http://stefanoricciardi.files.wordpress.com/2010/01/cr_documentorlogo.gif" border="0" alt="cr_documentor-logo" width="100" height="102" align="right" /></a>Requirements:
<ul>
<li>Visual Studio 2005 or greater (I am pretty confident that you need at least a Professional version as opposed to Express). I am running it on Visual Studio Team System 2008, not sure whether it works also on 2010.</li>
<li>The DXCore plugin framework from DevExpress. Possibly the best (and only?) way to get it is to get through the excellent free <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/">CodeRush Xpress for C# and VB</a></li>
</ul>
</li>
<li>Download the plugin: CR Documentor is hosted at Google Code at <a href="http://code.google.com/p/cr-documentor/">this link</a>.</li>
<li>Copy the dll in your DX-Core plugin-folder (<tt>C:\Users\&lt;username&gt;\Documents\DevExpress\IDE Tools\Community\PlugIns</tt>)</li>
<li>Restart Visual Studio</li>
</ul>
<h3>Usage</h3>
<ol>
<li>CR Documentor adds itself in the right click menu, close to the bottom. From the submenu, choose “Show CR_Documentor window”.<a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/cr_documentor1.png"><img style="display:inline;margin-left:0;margin-right:0;border-width:0;" title="CR_documentor-1" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/cr_documentor1_thumb.png" border="0" alt="CR_documentor-1" width="244" height="212" /></a></li>
<li>A new window opens up in floating mode (I prefer to dock-it to the right side together with my solution explorer and luckily the plug-in remembers this choice every time I open the window after closing it and at startup).<a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image.png"><img style="display:inline;border-width:0;" title="image" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image_thumb.png" border="0" alt="image" width="244" height="127" /></a></li>
<li>Now every time your cursor is on an XML doc, you can see the preview in the Documentor window. See for example when I put the cursor on the XML doc of a class: I get a complete picture of the documentation for that class and its methods all in real time.<br />
<a href="http://stefanoricciardi.files.wordpress.com/2010/01/image1.png"><img style="display:inline;border-width:0;" title="image" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image_thumb1.png" border="0" alt="image" width="229" height="244" /></a></li>
<li>There are a few other features that I don’t use very often. All of them are accessible by the right-click content sensitive menu:
<ul>
<li>Expand/Collapse all XML comments in the editor</li>
<li>Insert XML docs templates (<a href="http://stefanoricciardi.com/2009/06/19/must-have-vs-2008-free-plug-ins-2-ghost-doc/">I prefer to use GhostDoc for that</a>).</li>
<li></li>
</ul>
</li>
</ol>
<h3>Configuration</h3>
<p>Like all DXCore plugins, you can access to the configuration by pressing ALT+CTRL+SHIFT+O combination. I like to check all my options to Sandcastle because that’s the tool that I will be using to create the final XML documentation.</p>
<p><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image2.png"><img style="display:inline;border-width:0;" title="image" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/image_thumb2.png" border="0" alt="image" width="244" height="161" /></a></p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f01%2f22%2fsee-your-xml-docs-as-you-type-with-cr-documentor%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f01%2f22%2fsee-your-xml-docs-as-you-type-with-cr-documentor%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/See-Your-XML-Docs-As-You-Type-With-CR-Documentor-Stefano-Ricciardis-Blog"><img style="border:0;" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F22%2Fsee-your-xml-docs-as-you-type-with-cr-documentor%2F" alt="Shout it" /></a></p>
<p><!-- AddThis Button BEGIN --></p>
<p><a href="http://www.addthis.com/bookmark.php?v=250"><img style="border-width:0;" src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="Bookmark and Share" width="125" height="16" /></a></p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e6ceeafa-fe5c-4bd6-a48d-325da43e5abc" class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Programming">Programming</a>,<a rel="tag" href="http://technorati.com/tags/C%23">C#</a>,<a rel="tag" href="http://technorati.com/tags/visual+Studio+2008">visual Studio 2008</a>,<a rel="tag" href="http://technorati.com/tags/Tools">Tools</a></div>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/01/22/see-your-xml-docs-as-you-type-with-cr-documentor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Year&#039;s Resolutions for 2010</title>
		<link>http://stefanoricciardi.com/2010/01/08/new-years-resolutions-for-2010/</link>
		<comments>http://stefanoricciardi.com/2010/01/08/new-years-resolutions-for-2010/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 13:52:36 +0000</pubDate>
		<dc:creator>stefanoricciardi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[Design and Patterns]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://stefanoricciardi.com/?p=653</guid>
		<description><![CDATA[The new year has just started and it&#8217;s time for me to share my professional life resolutions for the upcoming year. Through books, articles, blogs, podcasts, one hears about that language, or that technology, or that process which would be great to try and learn. Unfortunately, since the spare time is not infinite, one has [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F08%2Fnew-years-resolutions-for-2010%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F08%2Fnew-years-resolutions-for-2010%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The new year has just started and it&#8217;s time for me to share my professional life resolutions for the upcoming year.</p>
<p>Through books, articles, blogs, podcasts, one hears about that language, or that technology, or that process which would be great to try and learn. Unfortunately, since the spare time is not infinite, one has to make choices and concentrate on what might give the best return on investment in the short/medium term. The following are the two or three things which I have chosen to dive in this year:<br />
<!-- more --></p>
<h3>Read the Blue Book</h3>
<p><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/dddbook.jpg"><img class="size-full wp-image-655" style="display:inline;margin-left:5px;margin-right:0;" title="Domain Driven Design Book" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/dddbook.jpg" alt="" width="98" height="125" align="right" /></a><strong> </strong><a href="http://www.amazon.co.uk/Domain-driven-Design-Tackling-Complexity-Software/dp/0321125215/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1262868697&amp;sr=8-1">Domain-Driven Design</a> by Eric Evans is one of the best book that I have come across on software design in a while. Not always an easy read (some say it&#8217;is &#8220;dense&#8221;), I am going through it slower than usual: every chapter is full of sound advices and deep concepts that take a while to sink in.</p>
<p>Luckily in my current project I will have the opportunity to apply many concepts from this approach. For this reason alone, this makes to the top of my list for 2010.</p>
<h3><strong>Learn Ruby</strong></h3>
<p><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/ruby-logo.png"><img class="alignright size-full wp-image-658" style="float:right;margin-left:0;margin-right:0;" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/ruby-logo.png" alt="Ruby Logo" width="117" height="135" /></a>2009 has been for me the year of C#. The Pragmatic Programmer suggests to both to learn a new language every year and getting familiar with one scripting language. Most experts seem to agree that learning a language with a different paradigm from the one you use everyday is a big plus. Martin Fowler (who <a href="http://martinfowler.com/bliki/EvaluatingRuby.html">favors Ruby</a>) states that:</p>
<blockquote><p>[...] programming languages do affect the way you think about programming, and learning new languages can do a lot to help you think about solving problems in different ways. (It&#8217;s important to learn languages that are quite different in order to get the benefit of this. Java and C# are too similar to count.)</p></blockquote>
<p>I am not expecting to become proficient with Ruby in the near future (after all, I will still be using C# in my every-day at work). However from what I have seen so far it really looks like a great language to learn, so I am looking forward to it.</p>
<h3>Play with Subversion</h3>
<p><a href="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/subversioncrop.png"><img style="display:inline;margin-left:0;margin-right:0;border-width:0;" title="SubversionCrop" src="http://69.175.59.226/~stefano3/blog/wp-content/uploads/2010/01/subversioncrop_thumb.png" border="0" alt="SubversionCrop" width="244" height="37" align="right" /></a> In my previous job at Motorola I was developing in a mixed Unix and Windows environment; <a href="http://www-01.ibm.com/software/awdtools/clearcase/multisite/index.html">Rational Clearcase Multisite</a> was the company-wide version control tool. Clearcase is a real heavy weight, and probably one of the few tools that can handle teams of hundreds of developers located anywhere word-wide.</p>
<p>When I landed my current job I had to switch to the much more limited (and widely <a href="http://www.codinghorror.com/blog/archives/000660.html">hated</a>) Microsoft Source Safe (hey… always better than no version control at all, right?) Luckily, rumors has it that we might soon migrate to <a href="http://subversion.tigris.org/">Subversion</a>.  Subversion is widely used in the open source community and I guess I’ll need it once I start playing with Ruby and downloading libraries etc…</p>
<h3>Other Books to Read</h3>
<p><a title="Reading Book Stack, by stevewilhelm" href="http://www.flickr.com/photos/stevewilhelm/489404053/"><img style="float:right;margin-left:5px;margin-right:0;" src="http://farm1.static.flickr.com/209/489404053_b91cd84d73_t.jpg" alt="" width="67" height="100" /></a>Beside the blue book, there are a few other books that I plan to complete reading this year. I have already started <a href="http://www.amazon.co.uk/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1262899365&amp;sr=8-1">Clean Code</a> and <a href="http://www.amazon.co.uk/Pragmatic-Thinking-Learning-Refactor-Programmers/dp/1934356050/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1262899448&amp;sr=1-1">Pragmatic Thinking and Learning</a>. Next on my list is <a href="http://www.amazon.co.uk/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1262899498&amp;sr=1-1">Working Effectively With Legacy Code</a> and <a href="http://www.amazon.co.uk/Agile-Estimating-Planning-Robert-Martin/dp/0131479415/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1262899606&amp;sr=1-1">Agile Estimating and Planning</a>. I promised myself not to buy any more book before I clean my current queue!</p>
<h3>Stuff Left for 2011</h3>
<p>As I mentioned, there are so many other things I would love to investigate and play with, but there is only so much time available, considering that 2010 will bring in .Net4.0 and C#4.0 that will surely be a priority.</p>
<p>Therefore, the following I guess will have to wait till 2011:</p>
<ul>
<li>Learning a functional programming language (possibly Haskell or F#)</li>
<li>Getting familiar Domain Specific Languages (Martin Fowler is preparing a <a href="http://martinfowler.com/dslwip/">book</a> on the topic)</li>
<li>Play with Android and/or iPhone development</li>
<li>The Next Big Thing from 2010!</li>
</ul>
<div><em>Photo of the stack of books by Steve Wilhelm (<a rel="cc:attributionURL" href="http://www.flickr.com/photos/stevewilhelm/">http://www.flickr.com/photos/stevewilhelm/</a> / <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/">CC BY-NC-SA 2.0</a>)</em></div>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f01%2f08%2fnew-years-resolutions-for-2010%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fstefanoricciardi.com%2f2010%2f01%2f08%2fnew-years-resolutions-for-2010%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<p><a rev="vote-for" href="http://dotnetshoutout.com/New-Years-Resolutions-for-2010"><img style="border:0;" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fstefanoricciardi.com%2F2010%2F01%2F08%2Fnew-years-resolutions-for-2010%2F" alt="Shout it" /></a></p>
<p><!-- AddThis Button BEGIN --><br />
<a href="http://www.addthis.com/bookmark.php?v=250"><img style="border:0 none;" src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="Bookmark and Share" width="125" height="16" /></a><br />
<!-- AddThis Button END --></p>
]]></content:encoded>
			<wfw:commentRss>http://stefanoricciardi.com/2010/01/08/new-years-resolutions-for-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
