<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.stevesmithblog.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0"><channel><title>Steve Smith's Blog</title><link>http://stevesmithblog.com/</link><description>Musings on Software and the Developer Community</description><generator>Graffiti CMS 1.2 (build 1.2.0.2308)</generator><lastBuildDate>Wed, 01 Sep 2010 00:22:00 GMT</lastBuildDate><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.stevesmithblog.com/StevenSmith" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="stevensmith" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">StevenSmith</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Applying Interface Segregation to Configuration Files</title><link>http://stevesmithblog.com/blog/applying-interface-segregation-to-configuration-files/</link><pubDate>Wed, 01 Sep 2010 00:22:00 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/applying-interface-segregation-to-configuration-files/</guid><dc:creator>ssmith</dc:creator><slash:comments>0</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;In .NET, it’s very easy to set up &lt;a href="http://stevesmithblog.com/blog/custom-configuration-section-handlers/"&gt;custom configuration section handlers&lt;/a&gt; to handle your application or component’s configuration needs.&amp;#160; As my previous post shows, it’s also very easy to configure these with attributes that enforce required fields and other validation.&amp;#160; However, over time it’s very easy to create fairly large configuration sections that violate the &lt;a href="http://en.wikipedia.org/wiki/Interface_segregation_principle" rel="nofollow"&gt;Interface Segregation Principle&lt;/a&gt;, which states that classes shouldn’t be forced to depend on things they don’t need.&lt;/p&gt;  &lt;p&gt;Consider this relatively simple configuration section:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;configSections&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;section&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ConfigurationSettings&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;InterfaceSegregation.Configuration1.ConfigurationSettings, InterfaceSegregation&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;configSections&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ConfigurationSettings&lt;/span&gt; &lt;br /&gt;  &lt;span style="color: #ff0000"&gt;ApplicationName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Interface Segregation&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #ff0000"&gt;AuthorName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Steve Smith&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #ff0000"&gt;CacheDuration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;60&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #ff0000"&gt;DatabaseServerName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;localhost&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #ff0000"&gt;DatabaseName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Northwind&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #ff0000"&gt;DatabaseUserName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ssmith&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #ff0000"&gt;DatabasePassword&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;secret&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #ff0000"&gt;WebServiceBaseUri&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://localhost/&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I’ve intentionally made it a bit more verbose than needed (obviously the database settings could be combined into a connection string, etc), but the intent is to show that my relatively generic Settings section has completely lost its &lt;em&gt;cohesion&lt;/em&gt;.&amp;#160; Let’s look at an interface that we’ve created to support these settings (because we don’t want to have an &lt;a href="http://stevesmithblog.com/blog/insidious-dependencies/"&gt;Insidious Dependency On Our Configuration File&lt;/a&gt; in our code):&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; IConfigurationSettings : IApplicationIdentitySettings&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #008000"&gt;// application identity settings&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ApplicationName { get; }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; AuthorName { get; }&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: #008000"&gt;// performance tuning settings&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; CacheDuration { get; }&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: #008000"&gt;// data access settings&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; DatabaseServerName { get; }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; DatabaseName { get; }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; DatabaseUserName { get; }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; DatabasePassword { get; }&lt;br /&gt;        &lt;br /&gt;    &lt;span style="color: #008000"&gt;// web service api settings&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; WebServiceBaseUri { get; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;From the comments I’ve included in this interface, it’s clear that there are four different kinds of settings grouped together by this interface.&amp;#160; With only 8 properties, it has already become an example of a “fat” interface.&amp;#160; Now let’s look at one of the clients of this interface, a simple AboutPage file (that isn’t an ASP.NET page, but could be):&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; AboutPage&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;readonly&lt;/span&gt; IConfigurationSettings _configurationSettings;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; AboutPage(IConfigurationSettings configurationSettings)&lt;br /&gt;    {&lt;br /&gt;        _configurationSettings = configurationSettings;&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; AboutPage() : &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;(ConfigurationSettings.Settings)&lt;br /&gt;    {}&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Render(TextWriter writer)&lt;br /&gt;    {&lt;br /&gt;        writer.Write(&lt;span style="color: #006080"&gt;&amp;quot;{0} By {1}&amp;quot;&lt;/span&gt;, &lt;br /&gt;            _configurationSettings.ApplicationName, &lt;br /&gt;            _configurationSettings.AuthorName);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;This class takes advantage of Dependency Injection to eliminate a direct dependency on the ConfigurationSettings class/file, through the use of the IConfigurationSettings interface.&amp;#160; However, it’s still depending on a much larger interface than it needs, and thus is violating ISP.&amp;#160; Fortunately, there’s a very easy fix for this that will let us ensure this class only depends on what it needs, without breaking anything else in our application.&amp;#160; The refactoring involves creating a new interface for AboutPage to depend upon, that is more cohesive and only includes things AboutPage (and perhaps other classes that require the same things) requires.&amp;#160; First, we need to identify these settings and come up with a name for the new interface:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; IApplicationIdentitySettings&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ApplicationName { get; }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; AuthorName { get; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to modify the IConfigurationSettings interface so that it no longer has these settings, but inherits them from the newly created IApplicationIdentitySettings interface:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; IConfigurationSettings : IApplicationIdentitySettings&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #008000"&gt;// performance tuning settings&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; CacheDuration { get; }&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: #008000"&gt;// data access settings&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; DatabaseServerName { get; }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; DatabaseName { get; }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; DatabaseUserName { get; }&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; DatabasePassword { get; }&lt;br /&gt;        &lt;br /&gt;    &lt;span style="color: #008000"&gt;// web service api settings&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; WebServiceBaseUri { get; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Finally, the AboutPage class can be modified to use the new, more focused interface.&amp;#160; In its default constructor, though, it can still use the ConfigurationSettings.Settings class, as this implements IConfigurationSettings, which now automatically implements IApplicationIdentitySettings:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; AboutPage&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;readonly&lt;/span&gt; IApplicationIdentitySettings _applicationIdentitySettings;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; AboutPage(IApplicationIdentitySettings applicationIdentitySettings)&lt;br /&gt;    {&lt;br /&gt;        _applicationIdentitySettings = applicationIdentitySettings;&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; AboutPage()&lt;br /&gt;        : &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;(ConfigurationSettings.Settings)&lt;br /&gt;    { }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Render(TextWriter writer)&lt;br /&gt;    {&lt;br /&gt;        writer.Write(&lt;span style="color: #006080"&gt;&amp;quot;{0} By {1}&amp;quot;&lt;/span&gt;,&lt;br /&gt;            _applicationIdentitySettings.ApplicationName,&lt;br /&gt;            _applicationIdentitySettings.AuthorName);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Interface Segregation Principle states that classes should not be forced to depend on things they do not use.&amp;#160; By refactoring “fat” interfaces into smaller, more focused and cohesive interfaces defined by the clients that use them, we can reduce the coupling in our code.&amp;#160; This results in code that is easier to change, maintain, and test, not to mention being much more fun to work with.&amp;#160; Be breaking up the fat interface but using interface inheritance to ensure the original interface remains unchanged, this refactoring can be done to existing codebases without requiring extensive changes that spider through every class that touches the original interface.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P2_deile2pFyr9JjCs2MM3n0VX0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P2_deile2pFyr9JjCs2MM3n0VX0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P2_deile2pFyr9JjCs2MM3n0VX0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P2_deile2pFyr9JjCs2MM3n0VX0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=V57Ojmpxxlo:_DamYfjNYI0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=V57Ojmpxxlo:_DamYfjNYI0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=V57Ojmpxxlo:_DamYfjNYI0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=V57Ojmpxxlo:_DamYfjNYI0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=V57Ojmpxxlo:_DamYfjNYI0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=V57Ojmpxxlo:_DamYfjNYI0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/V57Ojmpxxlo" height="1" width="1"/&gt;</description></item><item><title>Startup Business Checklist 2010</title><link>http://stevesmithblog.com/blog/startup-business-checklist-2010/</link><pubDate>Wed, 25 Aug 2010 16:30:00 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/startup-business-checklist-2010/</guid><dc:creator>ssmith</dc:creator><slash:comments>7</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="checklist" border="0" alt="checklist" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/StartupBusinessChecklist2010_C80D/checklist_3.jpg" width="180" height="240" /&gt; &lt;/p&gt;  &lt;p&gt;Below is my current checklist for startup businesses in 2010.&amp;#160; This is meant to be relatively industry-agnostic and focuses primarily on online components of the business (meaning, it may not apply to businesses which avoid the Internet for whatever reason).&amp;#160; I’ve included numerous links to more information and references.&amp;#160; Checklists are a great way to ensure you don’t forget important things – check out the &lt;a href="http://www.amazon.com/gp/product/0805091742?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0805091742"&gt;Checklist Manifesto&lt;/a&gt; for how one doctor is attempting to apply this logic to medicine.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;If you’re not reading this on my blog, you’re likely missing out on the latest updates to this post – click here to view the source article: &lt;a href="http://stevesmithblog.com/blog/startup-business-checklist-2010/"&gt;Startup Business Checklist 2010&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://stevesmithblog.s3.amazonaws.com/Startup Business Checklist 2010.pdf"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="Download_PDF_blackandred" border="0" alt="Download_PDF_blackandred" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/StartupBusinessChecklist2010_7F43/Download_PDF_blackandred_cf3296c8-0706-4ceb-b9d8-1ea52b6c7ec0.gif" width="224" height="76" /&gt; Download the PDF&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Domain(s)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You’re going to need a domain name.&amp;#160; Maybe more than one.&amp;#160; At a minimum, unless you’re trying to be clever with an oddball root domain like del.icio.us or bit.ly, you’re going to want a .com address.&amp;#160; If you find several variants, choose one that is your canonical (the one you want everyone to use) URL, and ensure the other domains either 301 redirect to the main URL, or have some content that sends links to your main URL.&amp;#160; I use GoDaddy for all of my domains, but there are plenty of other domain registrars available.&amp;#160; You shouldn’t need to pay more than $10 per year for a domain (not counting any other services).&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://godaddy.com" rel="nofollow"&gt;GoDaddy&lt;/a&gt; (direct link) | &lt;a title="Go Daddy $7.49 .com Sale" href="http://affiliate.godaddy.com/redirect/70393AED1BC22AE9885F682D936D05067C09FBAB269EB1E6A63B414D03AC5DB1" rel="nofollow"&gt;Go Daddy $7.49 .com Domain Sale&lt;/a&gt; (sale/affiliate link) &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.directnic.com/" rel="nofollow"&gt;DirectNIC&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.register.com/"&gt;Register.com&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;I’ve personally used each of the above services, and they’re ranked in order of my preference.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Note that you may get some extra SEO benefit from having an established domain (one that has been registered for some time) as well as a domain that does not expire for a long time (expiration more than a year or two in the future).&amp;#160; A useful tool for checking the status of a registered domain is WHOIS, which most domain registrars support (somewhere) or which you can do from &lt;a href="http://whois.com" rel="nofollow"&gt;Whois.com&lt;/a&gt; (which apparently also does domain registration but I can’t vouch for them).&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://domains.whois.com/domain.php?action=whois" rel="nofollow"&gt;WHOIS Lookup on Whois.com&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Email&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I’ve found that Google Apps (the free edition) is quite sufficient as a starting point for most start-up companies.&amp;#160; You get a ton of space, a great user interface that doesn’t require you to install anything locally and that you can use from anywhere, and virtually no spam.&amp;#160; For free (with non-intrusive ads).&amp;#160; And of course you can upgrade to give them money if and when you need to do so.&lt;/p&gt;  &lt;p&gt;It’s worth grabbing the domain and then email early on, as many of the steps below will require these.&amp;#160; Also, with the advent of OAuth and OpenID for authentication, you can very likely use your Google Email, Facebook, or Twitter account as your login for many of the other services listed here, saving you from having one more set of credentials to remember.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Web Hosting&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I’ve used each of the following for web hosting and have had good experiences with each one:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://partners.orcsweb.com/aw.aspx?A=3" rel="nofollow"&gt;ORCSWeb&lt;/a&gt; – Bar none the highest quality managed hosting company for Microsoft .NET applications.&amp;#160; If you want someone else to deal with keeping your web servers updated, online, and running 24/7 so you can deal with what your company actually does, call them. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://DiscountAsp.Net/"&gt;DiscountASP.Net&lt;/a&gt; – Very affordable and I know lots of people who swear by them.&amp;#160; Also dedicated to Microsoft solutions, as far as I know. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.dreamhost.com/"&gt;Dreamhost&lt;/a&gt; – I’ve used them for Wordpress blogs (and Michelle’s blog is hosted there now) and they’re inexpensive and their tools make getting started very easy.&amp;#160; I’m not familiar with them beyond Wordpress, but of course they offer other hosting options as well. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://wpengine.com?a_aid=ssmith" rel="nofollow"&gt;WP Engine&lt;/a&gt; – Recommended by Jason Cohen, WP Engine takes Wordpress to the next level.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;What you need for web hosting really depends on what kind of business you’re in.&amp;#160; If you’re building an online application, you probably will need a database, the ability to run code, etc.&amp;#160; If you’re launching a non-Internet business, then you might only need a basic marketing website, which you’re best of creating via a content management server (CMS) package.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Content Management Server&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Again, don’t underestimate &lt;a href="http://wordpress.org/"&gt;Wordpress&lt;/a&gt;.&amp;#160; It’s free and there are plugins for nearly everything.&amp;#160; However, one of the most common questions you’ll find in the Wordpress communities is “How do I make it not look like a blog?”&amp;#160; If you want a site you can manage without having to use developer tools and FTP, you definitely want to investigate content management servers or CMSes.&amp;#160; In v3 of Wordpress, which offers post types, there are themes available that let you do a lot without having to drop down to the raw PHP or HTML.&lt;/p&gt;  &lt;p&gt;In the Microsoft space, there are quite a few CMSes to choose from, including many commercial offerings.&amp;#160; My current favorite is &lt;a href="http://umbraco.org/"&gt;Umbraco&lt;/a&gt;, which is a nice open-source CMS that can handle medium- to large-scale sites.&amp;#160; It’s built on .NET and very extensible.&amp;#160; One of my Umbraco-certified friends, &lt;a href="http://craig.palenshus.com/"&gt;Craig Palenshus&lt;/a&gt;, uses Umbraco to manage the &lt;a href="http://nimblepros.com"&gt;NimblePros’ web site&lt;/a&gt;.&amp;#160; You can also use &lt;a href="http://graffiticms.codeplex.com/"&gt;Graffiti&lt;/a&gt; or &lt;a href="http://www.dotnetnuke.com/"&gt;DotNetNuke&lt;/a&gt; or any number of other commercial CMS offerings.&lt;/p&gt;  &lt;p&gt;Even if you’re building an online business built on custom software, it’s worth considering a CMS for your company site.&amp;#160; Remember, you may not want to use your developer resources for every change to your home page’s welcome text.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Analytics&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Another free Google tool, &lt;a href="http://www.google.com/analytics/"&gt;Google Analytics&lt;/a&gt; is really a no-brainer.&amp;#160; It’s not perfect.&amp;#160; It’s even a little shady at times (like, if a user has ever come to your site by way of any search on Google, they are forever after categorized as a visitor from Google, not an organic visitor.&amp;#160; It’s still an amazing tool for the (free – not even ads – you just are giving them loads of data for free) price tag.&amp;#160; Once you have an account, you just need to use the unique identifier or script blog in your blog and on your web site.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Blog&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Your company needs a website, but it probably also should have a blog.&amp;#160; People want to know what you’re doing, and your marketing brochure site (or social network, or whatever) doesn’t let them get to know you.&amp;#160; If you just want something for under $10/mo with no technical skill required that you can do just about anything with, then &lt;a href="http://wordpress.org"&gt;Wordpress&lt;/a&gt; is the way to go (see Dreamhost above).&amp;#160; If you’re a developer or have developers on your team and you have some &lt;strong&gt;valid reason&lt;/strong&gt; why it’s&lt;strong&gt; important&lt;/strong&gt; that you be able to change the code used to run your blog, then if PHP isn’t your thing you might look at these open source .NET alternatives:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.dotnetblogengine.net/"&gt;BlogEngine.Net&lt;/a&gt; – &lt;a href="http://brendan.enrick.com/"&gt;Brendan’s blog&lt;/a&gt; is now running this &lt;/li&gt;    &lt;li&gt;&lt;a href="http://graffiticms.codeplex.com/"&gt;Graffiti&lt;/a&gt; – My blog currently uses Graffiti &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.dasblog.info/"&gt;dasBlog&lt;/a&gt; – &lt;a href="http://www.hanselman.com/blog/"&gt;ScottHa’s blog&lt;/a&gt; uses dasBlog (of course, since he’s one of the main developers of dasBlog) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You’ll also want to use &lt;a href="http://feedburner.google.com/"&gt;Feedburner&lt;/a&gt; (now Google) for your feeds.&amp;#160; Saves you bandwidth and offers some nice features.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Logo&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You’re going to need a logo.&amp;#160; You might need one for your company and one for your product.&amp;#160; But you’ll need at least one.&amp;#160; If you know a good designer (like &lt;a href="http://craig.palenshus.com/"&gt;Craig&lt;/a&gt;), you can have them create one for you.&amp;#160; Otherwise, there are services out there that can produce a lot of logos for your consideration via a winner-take-all contest where you offer the prize.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://logotournament.com/"&gt;LogoTournament.com&lt;/a&gt; - $250 prize minimum.&amp;#160; I think they’re the dominant player in this category of sites. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://99designs.com/"&gt;99Designs.com&lt;/a&gt; – Same idea, about the same price, minimum &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I’ve also used &lt;a href="http://www.logobee.com/"&gt;LogoBee.com&lt;/a&gt; successfully in the past.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Customer Feedback&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Once you get some customers, even the non-paying beta users and early adopters, you’re going to want to know what they think.&amp;#160; Talk to as many of them as you can – there’s no substitute for that – but to get &lt;em&gt;scale&lt;/em&gt; you’re going to want a tool to manage feedback.&amp;#160; The two sites that make this very easy are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://uservoice.com/"&gt;UserVoice.com&lt;/a&gt; – My personal preference. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://getsatisfaction.com/"&gt;GetSatisfaction.com&lt;/a&gt; – Seems to be roughly the same as UserVoice, but much longer to say and spell…&amp;#160; Either one is probably a good choice over (a) nothing or (b) trying to build your own. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Project Management&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You’ll need some way to identify things that need doing, prioritizing these things, and seeing them progress from ideas to completed tasks.&amp;#160; There are about 6 billion project management software packages out there.&amp;#160; I’ve used a small fraction of these and have developed some opinions.&amp;#160; I personally prefer lean and mean and simple to big and complex and does everything you might never need.&amp;#160; If you’re already using UserVoice or GetSatisfaction, you might be able to use these for your project management, as well.&amp;#160; More likely, though, you’re going to want another tool.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://37Signals.com/"&gt;37Signals.com&lt;/a&gt; – BaseCamp has a huge following and has pretty low initial requirements/costs.&amp;#160; For a startup, it’s probably worth considering. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://AgileZen.com/"&gt;AgileZen.com&lt;/a&gt; – For simple software feature/bug tracking, a kanban board works great (literally, on a wall or whiteboard).&amp;#160; If you need something virtual, though, AgileZen is a nice tool for that job. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://axosoft.com/ontime"&gt;Axosoft OnTime&lt;/a&gt; – If you need more than just a kanban tracking board, OnTime probably has the features you need.&amp;#160; It’s a very full-featured software bug/feature/project management tool.&amp;#160; I have a love/hate relationship with it.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.pivotaltracker.com/" rel="nofollow"&gt;Pivotal Tracker&lt;/a&gt; – A free kanban/sprint planning tool.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Source Control (software development)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Assuming your business requires some custom software development, you’re going to need a place to safely store your code.&amp;#160; Depending on how selection above for web hosting, you might be able to host your source control on your hosted server(s).&amp;#160; If not, you can install&amp;#160; something in your office or use one of many online options.&amp;#160; The de facto standard free solution remains Subversion, but distributed source control platforms are becoming more popular every day, with the two leaders being Git and Mercurial.&amp;#160; If you go the Subversion route, I recommend &lt;a href="http://tortoisesvn.net/downloads"&gt;TortoiseSvn&lt;/a&gt; and &lt;a href="http://stevesmithblog.com/blog/installing-visualsvn-subversion/"&gt;VisualSvn Server&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I haven’t used hosted source control before, but these are the three I hear are the best:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://unfuddle.com/"&gt;Unfuddle.com&lt;/a&gt; – Hosted Subversion (and Git) &lt;/li&gt;    &lt;li&gt;&lt;a href="http://github.com/"&gt;Github.com&lt;/a&gt; – Hosted Git &lt;/li&gt;    &lt;li&gt;&lt;a href="http://bitbucket.org/"&gt;Bitbucket.org&lt;/a&gt; – Hosted Mercurial &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Don’t forget you can also use public open source code repositories for free (assuming you have few secrets):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.codeplex.com/"&gt;Codeplex.com&lt;/a&gt; – Microsoft open source projects with source control, issue tracking, and more.&amp;#160; Support for TFS, SVN, and Mercurial clients for source control. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://sourceforge.net/"&gt;SourceForge.net&lt;/a&gt;– The largest open source repository in the world &lt;/li&gt;    &lt;li&gt;&lt;a href="http://code.google.com/projecthosting/"&gt;Google Project Hosting (Google Code)&lt;/a&gt; – More free stuff from Google – supports SVN and Mercurial. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Continuous Integration (software development)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If your business requires custom software development, you should have a build server that performs builds (and tests) every time your team checks in changes to the application.&amp;#160; If you don’t, you’re doing it wrong.&amp;#160; My two favorites are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.jetbrains.com/teamcity/"&gt;TeamCity&lt;/a&gt; – Free for small projects, worth it for larger ones, and almost entirely web-based setup and configuration.&lt;a href="http://www.google.com/reader" rel="nofollow"&gt;http://www.google.com/reader&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET"&gt;CruiseControl.Net&lt;/a&gt; – The grand-daddy of CI servers, CC.NET is full-featured but requires a fair bit of manual XML file tweaking to set up.&amp;#160; Be sure to get CCTray to go with it – that app rocks. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I’ve also used &lt;a href="http://msdn.microsoft.com/en-us/vstudio/ff637362.aspx"&gt;Visual Studio’s build server&lt;/a&gt;, which with the 2010 edition is quite easy to set up and use as well.&amp;#160; I haven’t used &lt;a href="http://hudson-ci.org/"&gt;Hudson&lt;/a&gt;, but I’m told it’s also good (Jason Cohen says he and most CruiseControl users he knows have switched to Hudson, which has “same basic tech, much better implementation.&amp;#160; Also has better support for things like ruby instead of mainly being for Java.”).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Social Networking&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You’re going to want to get social networking accounts that are as close to your domain and/or product name as possible.&amp;#160; The following listed ones are the minimum I recommend.&amp;#160; Even if you have nothing to say right now, it doesn’t cost you anything to set up these accounts and just sit on them for when you do decide you want to use them.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;( ) &lt;a href="http://twitter.com/"&gt;Twitter&lt;/a&gt; Account (usually in addition to your own, if you have one)&lt;/p&gt;    &lt;p&gt;( ) &lt;a href="http://youtube.com/"&gt;YouTube&lt;/a&gt; Account&lt;/p&gt;    &lt;p&gt;( ) &lt;a href="http://learn.linkedin.com/groups/"&gt;LinkedIn Group&lt;/a&gt; and/or &lt;a href="http://learn.linkedin.com/company-pages/"&gt;Company Page (coming soon)&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;( ) &lt;a href="http://www.facebook.com/pages/create.php"&gt;Facebook Page (Fan Page)&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;( ) &lt;a href="http://www.stumbleupon.com/"&gt;StumbleUpon&lt;/a&gt; Account&lt;/p&gt;    &lt;p&gt;( ) Other Sites via &lt;a href="http://knowem.com/"&gt;Knowem.com&lt;/a&gt; (checks hundreds of sites at once!)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If you do start needing to manage multiple social networking accounts, I’ve found &lt;a href="http://HootSuite.com/"&gt;HootSuite.com&lt;/a&gt; to be invaluable.&amp;#160; It lets you manage them all centrally, delegate permissions to others as needed without sharing the actual account credentials, and it works from anywhere (web app).&amp;#160; A nice option for a non-web solution is &lt;a href="http://tweetdeck.com/" rel="nofollow"&gt;TweetDeck&lt;/a&gt; (which I used until I switched to HootSuite).&lt;/p&gt;  &lt;p&gt;Another option if you have partners/cofounders is &lt;a href="http://cotweet.com/" rel="nofollow"&gt;cotweet&lt;/a&gt;, which offers a free account you can use to manage the company twitter account together.&amp;#160; It includes the ability to assign things to your colleagues for follow up, or to send/receive notifications about who is “on duty.”&amp;#160; Good stuff if you’re seriously looking to have an active presence on twitter.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) E-Commerce (if applicable)&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;( ) Checking Account&lt;/p&gt;    &lt;p&gt;Lots of choices.&amp;#160; Personally I prefer a bank with a physical presence near me so that I can meet a real person if problems arise, rather than going through their automated or offshored phone system.&lt;/p&gt;    &lt;p&gt;( ) Payment Processor&lt;/p&gt;    &lt;p&gt;Lots of choices again.&amp;#160; I’ve used and have generally heard good things about &lt;a href="http://www.authorize.net/" rel="nofollow"&gt;Authorize.Net&lt;/a&gt;.&amp;#160; I’ve heard good and bad things about &lt;a href="http://paypal.com/" rel="nofollow"&gt;PayPal&lt;/a&gt;.&amp;#160; And of course you may be able to bypass dealing with this level of detail entirely if you are selling a virtual product, in which case you might use a service like &lt;a href="http://www.fastspring.com/"&gt;FastSpring&lt;/a&gt;, which NimblePros uses to sell its &lt;a href="http://nitriq.com/"&gt;Nitriq code analyzer&lt;/a&gt; and &lt;a href="http://getatomiq.com/"&gt;Atomiq code de-duplicator&lt;/a&gt; products.&amp;#160; Note some of the services listed under Storefront application can also be leveraged to process your payments.&lt;/p&gt;    &lt;p&gt;( ) Storefront application&lt;/p&gt;    &lt;p&gt;Many choices.&amp;#160; You can roll your own.&amp;#160; There are open source solutions available like &lt;a href="http://www.nopcommerce.com/default.aspx" rel="nofollow"&gt;nopcommerce&lt;/a&gt; for ASP.NET.&amp;#160; You can also integrate with services like &lt;a href="http://checkout.google.com/sell/" rel="nofollow"&gt;Google Checkout&lt;/a&gt;, &lt;a href="http://smallbusiness.yahoo.com/ecommerce" rel="nofollow"&gt;Yahoo Stores&lt;/a&gt;, or &lt;a href="http://payments.amazon.com/" rel="nofollow"&gt;Amazon Payments&lt;/a&gt;.&amp;#160; Personally I’ve gone the roll your own approach in the past, but in most cases I would recommend building on an existing product or service, especially as a quick way to get to market.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Google Alerts&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;( ) Find and monitor 3-6 competitors&lt;/p&gt;    &lt;p&gt;&lt;a href="http://google.com/alerts" rel="nofollow"&gt;Google Alerts&lt;/a&gt; is another perpetually beta service offered by the giant company.&amp;#160; If you haven’t used it before, basically you give it search terms you’re interested in (like, say, your competitors’ product and company names, along with your own), and then it will email you whenever Google finds new content that matches these terms.&amp;#160; You can set it to batch up the results and email you once per day or per week, or to email you immediately.&amp;#160; Be sure to monitor your twitter alias and blog name if these differ from your product/company name.&amp;#160; I recommend getting the emails as they happen, as this lets you quickly join the conversation when it involves your product in the blogotwitterosphere.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Update Personal LinkedIn&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;( ) Answer (and Ask) Questions on LinkedIn related to your industry&lt;/p&gt;    &lt;p&gt;( ) Find other communities where you can become known as an authority&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Find and Connect with Bloggers, Twitter Users in your industry’s community&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;How you do this will depend on your industry and your existing relationship with its community.&amp;#160; Use your favorite search engine to search for articles and news of interest to your industry, and note the top blogs that come back from such searches.&amp;#160; Begin by following these people using your RSS reader (Google Reader is nice if you don’t have a preference; Microsoft Outlook also supports RSS subscriptions).&amp;#160; Most prominent bloggers are likely to also be active on Twitter at this point, so follow them there as well.&amp;#160; You’ll most likely have separate accounts for personal use and for your brand/company/product, so choose whether it makes sense to follow these individuals with either or both such accounts.&lt;/p&gt;  &lt;p&gt;Check this off when you’ve found 5 influentials in your industry whom you are now following.&amp;#160; Make a point to engage with them via their blog and/or twitter.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Grade and Track Web site&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Once you have your web site up, it’s a good idea to monitor it using a tool like &lt;a href="http://websitegrader.com/" rel="nofollow"&gt;WebsiteGrader.com&lt;/a&gt;.&amp;#160; This is separate from looking at your site’s traffic via Analytics (above).&amp;#160; WebsiteGrader will give you a bunch of metrics related to how your site performs from technical, search engine optimization, and social media perspectives.&amp;#160; I suggest logging the main metrics for your website (and twitter) and comparing yours with your main competitors on a periodic (monthly or quarterly) basis.&amp;#160; You’ll find Grader apps for Twitter, Facebook, LinkedIn, Books, Press Releases and more at &lt;a href="http://grader.com/" rel="nofollow"&gt;Grader.com&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Scout labs or similar tracking&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You’ll want to track some of the things you discover over time so you can see how you’re doing compared to your competition.&amp;#160; &lt;a href="http://ScoutLabs.com/" rel="nofollow"&gt;ScoutLabs&lt;/a&gt; appears to do this very well, though I haven’t used their product myself (it’s not necessarily cheap).&amp;#160; However, it does look very impressive.&amp;#160; Assuming you don’t have tons of VC money to spend, an alternative is to use Excel or a Google Spreadsheet to track your Twitter followers, Feedburner subscribers, WebsiteGrader score, and competitors’ scores over time.&amp;#160; And you can make the pretty charts yourself, too.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;( ) Subscribe to your own personal LinkedIn RSS feed&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Assuming you’re using an RSS reader regularly already, this can be an easy way to keep up with your professional contacts, and expand your network.&amp;#160; The RSS feed should be here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.linkedin.com/rssAdmin?display=" href="http://www.linkedin.com/rssAdmin?display="&gt;http://www.linkedin.com/rssAdmin?display=&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;assuming you have a LinkedIn account already and are signed in.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Acknowledgements&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Thanks to &lt;a href="http://blog.asmartbear.com/"&gt;Jason Cohen (a smart bear)&lt;/a&gt; for adding a few great ideas to the list.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pC91oY88ajXp8C8M0c_6nA5pzzs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pC91oY88ajXp8C8M0c_6nA5pzzs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pC91oY88ajXp8C8M0c_6nA5pzzs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pC91oY88ajXp8C8M0c_6nA5pzzs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=KjE4aG6Z0Vw:rnH4LgyYINg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=KjE4aG6Z0Vw:rnH4LgyYINg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=KjE4aG6Z0Vw:rnH4LgyYINg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=KjE4aG6Z0Vw:rnH4LgyYINg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=KjE4aG6Z0Vw:rnH4LgyYINg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=KjE4aG6Z0Vw:rnH4LgyYINg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/KjE4aG6Z0Vw" height="1" width="1"/&gt;</description></item><item><title>System.Core in VS2010 Projects</title><link>http://stevesmithblog.com/blog/system-core-in-vs2010-projects/</link><pubDate>Tue, 24 Aug 2010 14:11:49 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/system-core-in-vs2010-projects/</guid><dc:creator>ssmith</dc:creator><slash:comments>0</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;I just ran into an odd issue with a VS2010 project.&amp;#160; In my case it was an MVC 2 application I was upgrading from VS2008.&amp;#160; One of the built-in controllers (ProfileController) was failing to compile because it could not resolve the Linq extension method symbols Single() and Matches().&amp;#160; These are located in the System.Core assembly.&amp;#160; I checked my project references in Solution Explorer, and System.Core was not listed.&amp;#160; So I tried Add Reference, and System.Core was listed as included and gave me the option of to Remove it.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SNAGHTML4f275de" border="0" alt="SNAGHTML4f275de" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/System.CoreinVS2010Projects_8F5F/SNAGHTML4f275de_1.png" width="500" height="289" /&gt;&lt;/p&gt;  &lt;p&gt;After some searching, I found this blog post, aptly named &lt;a href="http://geekswithblogs.net/leesblog/archive/2010/04/23/do-not-remove-the-reference-to-system.core-from-your-vs2010.aspx" rel="nofollow"&gt;Do NOT remove the reference to System.Core from your VS2010 Project&lt;/a&gt;.&amp;#160; It pointed out that this file is “special” and that if you remove it (or it gets lost somehow) you need to re-add it manually to your project using this syntax:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160; &amp;lt;ItemGroup&amp;gt;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Reference Include=&amp;quot;System.Core&amp;quot; /&amp;gt;         &lt;br /&gt;&amp;#160; &amp;lt;/ItemGroup&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;There is also a connect issue describing this bug (which is currently marked as Postponed), &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/details/525663/cannot-remove-system-core-dll-reference-from-a-vs2010-project" rel="nofollow"&gt;Cannot remove System.Core.dll reference from a VS2010 project&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In my case this appears to have been an upgrade issue, as the project worked fine in VS2008 before I ran the upgrade wizard to VS2010, and then in the course of trying to get it to compile for the first time, I ran into this issue.&amp;#160; Adding the assembly to the project file by hand (via Notepad) solved the problem in my case.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zyyCp-Sbl-o0Dyhzh1Lrw2hCDqY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zyyCp-Sbl-o0Dyhzh1Lrw2hCDqY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zyyCp-Sbl-o0Dyhzh1Lrw2hCDqY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zyyCp-Sbl-o0Dyhzh1Lrw2hCDqY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=S7fAIFob2N0:9SiFBoQ4WVo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=S7fAIFob2N0:9SiFBoQ4WVo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=S7fAIFob2N0:9SiFBoQ4WVo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=S7fAIFob2N0:9SiFBoQ4WVo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=S7fAIFob2N0:9SiFBoQ4WVo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=S7fAIFob2N0:9SiFBoQ4WVo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/S7fAIFob2N0" height="1" width="1"/&gt;</description></item><item><title>Using CCTray with JetBrains TeamCity</title><link>http://stevesmithblog.com/blog/using-cctray-with-jetbrains-teamcity/</link><pubDate>Mon, 23 Aug 2010 15:36:37 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/using-cctray-with-jetbrains-teamcity/</guid><dc:creator>ssmith</dc:creator><slash:comments>0</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;&lt;a href="http://www.jetbrains.com/teamcity/" rel="nofollow"&gt;TeamCity&lt;/a&gt; is a great build server tool from &lt;a href="http://www.jetbrains.com/" rel="nofollow"&gt;JetBrains&lt;/a&gt; (makers of the awesome Visual Studio add-in, &lt;a href="http://www.jetbrains.com/resharper/" rel="nofollow"&gt;ReSharper&lt;/a&gt;).&amp;#160; The user-interface and features of the TeamCity web front-end are wonderful and are leaps and bounds easier to use for new users than my previous favorite, CruiseControl.Net, which required much XMLness to configure.&amp;#160; However, one of my favorite tools from CruiseControl, &lt;a href="http://sourceforge.net/projects/ccnet/files/" rel="nofollow"&gt;CCTray&lt;/a&gt;, still has no equal among competitors like TeamCity and even the Visual Studio tray watcher for Team Build.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Why CCTray Is Awesome&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;CCTray has one job and it does it extremely well.&amp;#160; That job is to let anybody interested in any software projects (that support CCTray) know whenever something happens with the build status of one of these projects.&amp;#160; It’s a lightweight, easy to configure tray application that more-or-less instantly provides feedback on build status via one or more of the following notification options:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Balloon window&lt;/li&gt;    &lt;li&gt;Custom sound&lt;/li&gt;    &lt;li&gt;Synthesized Speech&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Additionally, it shows at-a-glance status of all watched projects instantly (no need to wait for it to talk back to the server), and double-clicking on a given project will load its project page with details about the most recent build in the browser.&amp;#160; Custom sounds in the dev team area are a great way to ensure that all devs immediately know whenever a build fails.&amp;#160; I recommend having the team agree on standard sounds, and having at least one machine in the team room with speakers on and CCTray installed with these sounds.&amp;#160; When the red alert klaxon or similar “bad” sound starts playing, everyone should immediately be focused on getting the build fixed.&lt;/p&gt;  &lt;p&gt;CCTray supports unique sounds for successful builds, broken builds, fixed builds (first success after fails), and still failing (subsequent fails after first fail) builds.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CCTray sounds" border="0" alt="CCTray sounds" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/UsingCCTraywithJetBrainsTeamCity_A33C/SNAGHTML19b5e8_1.png" width="505" height="292" /&gt;&lt;/p&gt;  &lt;p&gt;Here are &lt;a href="http://gordonjl.com/node/38" rel="nofollow"&gt;some sample sounds you can get started with for CCTray&lt;/a&gt; build events.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Why JetBrains’ Tray App Is Less Awesome&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The built-in TeamCity build monitor is lacking in sounds and is also very slow to respond.&amp;#160; When you click on its icon, it needs to talk back to the server to get the latest status updates.&amp;#160; While this perhaps ensures the most up-to-date information, I’m looking for real-time responsiveness from my tray application – I know I can go hit a web page if I want the latest and greatest detail.&amp;#160; For a while there you couldn’t use more than one build server with the TC build monitor, too, but I believe this is now possible in the latest version.&amp;#160; Speediness and sounds are my main reasons for preferring CCTray at the moment, though.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Using CCTray with JetBrains TeamCity&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A couple of weeks ago, Yegor Yarko posted &lt;a href="http://youtrack.jetbrains.net/issue/TW-11295?query=project%3A+TeamCity" rel="nofollow"&gt;a plug-in for TeamCity that makes it possible to use TeamCity with CCTray&lt;/a&gt;.&amp;#160; He includes the instructions with the post – basically you just need to drop his add-in file into the .BuildServer/plugins folder and then restart TeamCity.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/UsingCCTraywithJetBrainsTeamCity_A33C/image_3.png" width="488" height="115" /&gt; &lt;/p&gt;  &lt;p&gt;You also need to make sure TeamCity is set up to have guest access enabled, which is done from the Administration – Server Configuration page.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TeamCity Configuration" border="0" alt="TeamCity Configuration" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/UsingCCTraywithJetBrainsTeamCity_A33C/image_8.png" width="476" height="391" /&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Finally, open up CCTray and point it at your TeamCity server’s URL with the following path:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;/guestAuth/app/cctray-standalone/cctray/projects.xml&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TeamCity URL" border="0" alt="TeamCity URL" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/UsingCCTraywithJetBrainsTeamCity_A33C/SNAGHTML18777d_1.png" width="481" height="484" /&gt;&lt;/p&gt;  &lt;p&gt;Voila!&amp;#160; You should now be able to view your projects via CCTray!&amp;#160; Install it on all of your team’s machines (and any project managers or customers who might care to watch the project’s progress) and keep the build GREEN.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Wz8YTzz9Zlys2aAgPQzkOw-hDh4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wz8YTzz9Zlys2aAgPQzkOw-hDh4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Wz8YTzz9Zlys2aAgPQzkOw-hDh4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wz8YTzz9Zlys2aAgPQzkOw-hDh4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=a1x4KluYGgI:rmlH6fsswA8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=a1x4KluYGgI:rmlH6fsswA8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=a1x4KluYGgI:rmlH6fsswA8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=a1x4KluYGgI:rmlH6fsswA8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=a1x4KluYGgI:rmlH6fsswA8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=a1x4KluYGgI:rmlH6fsswA8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/a1x4KluYGgI" height="1" width="1"/&gt;</description></item><item><title>Code Analysis Techniques</title><link>http://stevesmithblog.com/blog/code-analysis-techniques/</link><pubDate>Wed, 18 Aug 2010 03:47:01 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/code-analysis-techniques/</guid><dc:creator>ssmith</dc:creator><slash:comments>2</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;There are a number of code analysis tools available for .NET developers, including some stats that are built into the pricier SKUs of Visual Studio.&amp;#160; Recently, I’ve been playing with a relatively new product (released earlier this year by &lt;a href="http://nimblepros.com/"&gt;Microsoft agile consulting shop NimblePros.com&lt;/a&gt;) called &lt;a href="http://nitriq.com"&gt;Nitriq&lt;/a&gt;.&amp;#160; Nitriq is a bit like &lt;a href="http://linqpad.net/" rel="nofollow"&gt;LINQPad&lt;/a&gt; for your code.&amp;#160; If you’re not familiar with it, go download LINQPad now – it’s a great tool worth paying for.&amp;#160; I’ll wait until you’re back…&lt;/p&gt;  &lt;p&gt;Back?&amp;#160; Great!&amp;#160; I think we were discussing using Nitriq for code analysis, which by the way you can run for free on a single assembly.&amp;#160; Before going any further, it’s worth mentioning something that many of us often forget or perhaps never learned, and that is that &lt;strong&gt;code is data&lt;/strong&gt;.&amp;#160; Some languages, like &lt;a href="http://en.wikipedia.org/wiki/Lisp_%28programming_language%29"&gt;Lisp&lt;/a&gt;, make it very easy to manipulate code as if it were data (and vice versa), but even in static, managed languages like C# it is worth remembering that our code itself is data that we can query, analyze, and from which we can learn.&lt;/p&gt;  &lt;p&gt;So before we go any further, what kinds of questions might we ask of our code?&amp;#160; One of the best use cases for such code analysis is to find code smells, anti-patterns, and other things that would generally indicate a lack of quality.&amp;#160; &lt;a href="http://stevesmithblog.com/blog/principles-patterns-and-practices-of-mediocre-programming/"&gt;Static Cling is one-such anti-pattern I’ve described previously&lt;/a&gt; that it would be great if we could detect it.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Static Methods That Instantiate Objects&lt;/strong&gt;&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;var results = &lt;br /&gt;from m &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; Methods&lt;br /&gt;let ConstructorCalls = m.Calls.Where(&lt;br /&gt;    callMethod =&amp;gt; callMethod.IsConstructor).Count()&lt;br /&gt;&lt;span style="color: #0000ff"&gt;where&lt;/span&gt; m.IsStatic &amp;amp;&amp;amp; !m.IsConstructor &amp;amp;&amp;amp; ConstructorCalls &amp;gt; 0&lt;br /&gt;select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { m.MethodId, m.Name, m.FullName, ConstructorCalls };&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;There’s nothing inherently wrong with static methods from a testability and code quality standpoint provided they are leaf nodes in your object graph.&amp;#160; It’s when they start newing up objects that things tend to become tightly coupled and you start down the path toward the Big Ball of Mud architecture.&amp;#160; So, being able to find static methods that instantiate objects would be a worthwhile query to run.&amp;#160; It’s likely there are a few static methods that deserve to be made into instance methods on classes, and whatever objects they’re instantiating could probably be passed into the method or the new class’s constructor using dependency injection.&amp;#160; (I’m a big fan of keeping things loosely coupled by explicitly declaring dependencies – if you’re interested I have &lt;a href="http://www.google.com/search?q=dependencies+site%3Astevesmithblog.com" rel="nofollow"&gt;a few posts on dependencies&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;I know from experience that finding these kinds of static methods and cleaning them up is a very worthwhile exercise and will result in a better system.&amp;#160; The time to clean it up is usually either when you have some extra time in an iteration, or when you’re already touching the code in question – I don’t generally advocate spending large amounts of time purely on cleanup.&amp;#160; Customers like to see fixed bugs and new features, and delivering customer value needs to be the top priority.&amp;#160; But being able to maintain the ability to deliver that value requires keeping our codebase tidy – so clean up these dust bunnies when you encounter them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;General Stats&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="code stats" border="0" alt="code stats" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/CodeAnalysisTechniques_14E8B/image_3.png" width="149" height="244" /&gt; The code I’m running Nitriq on at the moment has the following stats (see image at right).&amp;#160; I’m analyzing 3 related assemblies in an ASP.NET web forms application.&amp;#160; You can see that these 3 “core” assemblies being analyzed have a total of 81 namespaces, 1067 types, 8876 methods, etc.&amp;#160; The total physical line count is about 64k.&amp;#160; These assemblies call other assemblies that aren’t included in the analysis, including third party DLLs and of course the .NET framework itself.&amp;#160; All told, that includes another 40 assemblies and another 2608 methods that aren’t directly included in the analysis, but are used by my assemblies.&lt;/p&gt;

&lt;p&gt;Running the query above to seek out static methods that instantiate objects, I get 228 such methods.&amp;#160; This works out to about 2.5% of the total codebase, which is pretty small, but in looking at the actual methods returned I immediately recognize several that I’ve struggled to test or refactor in the past, so I know I can make it better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Trouble Methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A number of computer science papers have linked cyclomatic complexity and line count of methods and files to the number of bugs occurring in these methods or files.&amp;#160; More recently, some papers have attempted to link design flaws with defect incidence, with some success[1].&amp;#160; There Naturally if the likelihood of bugs per lines of code is constant, one would expect there to be more of them in longer files than in shorter ones, but in fact the bug rate per line of code increases with the length of the file[1].&amp;#160; Unfortunately, accurate prediction of software defects is a difficult problem, as this 11-year-old IEEE Critique of Software Defect Prediction Models indicates[2].&amp;#160; But until we have better tools, it remains useful for us to attempt to keep our code neat, clean, and as simple as possible (but no simpler).&lt;/p&gt;

&lt;p&gt;One of the design flaws noted in D’Ambros’ paper is Dispersed Coupling, which relates to the number of other types used by a particular class (or method).&amp;#160; We can pull out this information, along with other useful data points like LOC, cyclomatic complexity, and parameter count using the following LINQ query against our code:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Methods to Refactor&lt;/strong&gt;&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;var results = &lt;br /&gt;from method &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; Methods&lt;br /&gt;&lt;span style="color: #0000ff"&gt;where&lt;/span&gt; (method.Cyclomatic &amp;gt; 25 || &lt;br /&gt;       method.PhysicalLineCount &amp;gt; 200 || &lt;br /&gt;       method.TypesUsed.Count &amp;gt; 30 || &lt;br /&gt;       method.ParameterCount &amp;gt; 7) &lt;br /&gt;   &amp;amp;&amp;amp; method.Type.IsInCoreAssembly&lt;br /&gt;select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { method.MethodId, method.Name, &lt;br /&gt;        method.Cyclomatic, method.PhysicalLineCount, &lt;br /&gt;        OutTypes = method.TypesUsed.Count, &lt;br /&gt;        method.ParameterCount };&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;Obviously we can tweak the values we’re interested in filtering out, but the above results in 74 results in the system I’m working with.&amp;#160; Here’s an example of the results:&lt;/div&gt;

&lt;div&gt;&lt;a href="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/CodeAnalysisTechniques_14E8B/image_7.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Click to enlarge results" border="0" alt="Click to enlarge results" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/CodeAnalysisTechniques_14E8B/image_thumb_2.png" width="543" height="345" /&gt;&lt;/a&gt; &lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;I’ve sorted the results by Cyclomatic in this case, which I like to keep as low as possible.&amp;#160; Out of almost 9,000 methods, having only about a dozen that have a 10 or higher CC score isn’t too awful, but again the ones at the bottom of this list are almost all (the exception being one generated code file) the nastiest classes in this system.&amp;#160; They really should each have a giant header comment saying “Here there be dragons” to warn any who enter them.&amp;#160; So, that tells me that this analysis, at least anecdotally and at the extremes, is worthwhile and able to locate “smelly” areas of my codebase.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;Once you know where the piles of crap are in your code, it makes it much safer for you to walk through it without getting dirty or spreading the smell around too much (how’s that for a metaphor?).&amp;#160; And of course, knowing where these festering piles of poo are means you can go and clean them up later.&amp;#160; If they’re tough to refactor, pick up a copy of &lt;a href="http://aspadvice.com/blogs/ssmith/archive/2008/05/13/Book_3A00_-Working-Effectively-With-Legacy-Code.aspx"&gt;Working Effectively With Legacy Code&lt;/a&gt; to help you introduce seams that will make the work easier.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;&lt;strong&gt;More Complex Queries&lt;/strong&gt;&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;Another code metric one can apply is the &lt;a href="http://semmle.com/semmlecode/documentation/semmlecode-glossary/lack-of-cohesion-of-methods-of-a-type-henderson-sellers/"&gt;Henderson-Sellers Lack of Cohesion&lt;/a&gt; metric.&amp;#160; This takes on the following form:&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;font color="#400080"&gt;The intuition underlying the Henderson-Sellers method of calculating Lack of Cohesion of Methods (LCOM) is that in a cohesive class &lt;em&gt;C&lt;/em&gt;, many methods access the same fields of &lt;em&gt;C&lt;/em&gt;. Formally, let &lt;/font&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;&lt;font color="#400080"&gt;&lt;em&gt;M&lt;/em&gt; = set of methods in class &lt;/font&gt;&lt;/li&gt;

    &lt;li&gt;&lt;font color="#400080"&gt;&lt;em&gt;F&lt;/em&gt; = set of fields in class &lt;/font&gt;&lt;/li&gt;

    &lt;li&gt;&lt;font color="#400080"&gt;&lt;em&gt;r&lt;/em&gt;(&lt;em&gt;f&lt;/em&gt;) = number of methods that access field &lt;em&gt;f&lt;/em&gt;&lt;/font&gt;&lt;/li&gt;

    &lt;li&gt;&lt;font color="#400080"&gt;&lt;em&gt;ar&lt;/em&gt; = mean of &lt;em&gt;r&lt;/em&gt;(&lt;em&gt;f&lt;/em&gt;) over &lt;em&gt;f&lt;/em&gt; in &lt;em&gt;F&lt;/em&gt;&lt;/font&gt;&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;&lt;font color="#400080"&gt;We then define LCOM of the class under consideration to be &lt;/font&gt;&lt;/p&gt;

  &lt;p&gt;&lt;font color="#400080"&gt;LCOM = (&lt;em&gt;ar&lt;/em&gt; - |&lt;em&gt;M&lt;/em&gt;|) / (1 - |&lt;em&gt;M&lt;/em&gt;|)&lt;/font&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;div&gt;A value greater than 0.9 is thought to merit investigation.&amp;#160; Even a relatively complex metric like this can be converted into a LINQ query fairly easily:&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;&lt;strong&gt;Henderson Sellers Lack of Cohesion of Methods&lt;/strong&gt;&lt;/div&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;var results = &lt;br /&gt;from type &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; Types&lt;br /&gt;let methodCount = type.Methods.Count&lt;br /&gt;let instanceFields = type.Fields.Where(f =&amp;gt; !f.IsStatic)&lt;br /&gt;let fieldAccesses = instanceFields.Select(f =&amp;gt; f.GotByMethods.Union(f.SetByMethods).Distinct()&lt;br /&gt;.Where(m =&amp;gt; m.Type == type).Count())&lt;br /&gt;let accessAverage = fieldAccesses.Count() == 0 ? 0 : fieldAccesses.Average().Round(2)&lt;br /&gt;let lcomHS = ((accessAverage - methodCount) / (1 - methodCount)).Round(2)&lt;br /&gt;&lt;span style="color: #0000ff"&gt;where&lt;/span&gt; lcomHS &amp;gt; .9 &amp;amp;&amp;amp;  instanceFields.Count() &amp;gt; 0 &amp;amp;&amp;amp; type.IsInCoreAssembly&lt;br /&gt;orderby lcomHS descending&lt;br /&gt;select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { type.TypeId, type.Name, lcomHS, methodCount, fieldCount = instanceFields.Count(), accessAverage, type.FullName };&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;[&lt;a href="http://eclipse-metrics.sourceforge.net/descriptions/LackOfCohesionInMethods.html"&gt;More on LOC-HS in the eclipse-metrics project on sourceforge&lt;/a&gt;]&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;In an ASP.NET application, a lot of ASP.NET Pages come back with values of 2 for this and can be safely ignored.&amp;#160; A quick and dirty way to do this in my project, since the web project is called “Foo.Web” is to add this to my where clause:&lt;/div&gt;

&lt;p&gt;&lt;font face="Consolas"&gt;&amp;amp;&amp;amp; !type.FullName.Contains(&amp;quot;Web&amp;quot;)&lt;/font&gt;&lt;/p&gt;

&lt;div&gt;That drops the number of results from 343 down to 119 – about 2/3 of the problems (and all of the ones with an lcomHS score of 2).&amp;#160; What remain are classes that, again, are generally worth looking at to see if they have design issues that should be addressed at some point.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;&lt;strong&gt;Code Audits&lt;/strong&gt;&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;Depending on your vertical industry, it may be worthwhile to have your code and/or architecture audited by a third party.&amp;#160; NimblePros, the company responsible for Nitriq, also offers such audits, as do a number of other reputable companies with which I’m familiar (and happy to recommend if contacted privately).&amp;#160; Code audits can provide a relatively inexpensive way to insure for non-technical or management stakeholders that the code being produced by contractors meets a certain quality bar.&amp;#160; Especially in the situation of government contracts, which are typically awarded to low bidders, some kind of independent check on quality should be a no-brainer to prevent waste (assuming of course the project wasn’t awarded to the governor’s teenage kid or something similar to begin with).&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;Leaving aside contractors, in-house development projects can often benefit from code audits as well, which typically include architecture, performance, security, and more.&amp;#160; The perspective of an outside authority can often uncover design decisions that represent “low hanging fruit” and can quickly and easily be adjusted to produce a much better solution.&amp;#160; Sometimes the hard part really is just knowing where the problem is – after that fixing it is easy.&amp;#160; That reminds me of a story I heard somewhere a long time ago, that I’ll wrap up with:&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;&lt;em&gt;The Engineer Turned Consultant&lt;/em&gt;&lt;/div&gt;

&lt;div&gt;Once upon a time there was an engineer who worked his entire career at a manufacturing plant, and then ultimately retired.&amp;#160; One day, the huge and expensive machinery responsible for the plant’s ongoing production broke down.&amp;#160; The staff tried to fix the problem, but hours turned into days without success, and the continued downtime would cost the company millions if not rectified swiftly.&amp;#160; The company called in the old engineer, who inspected the machine carefully for some time, then marked a particular part with a piece of chalk and said “Replace this part.”&amp;#160; The factory staff did as he recommended, and in no time the plant was back up and running.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;Not long after, the company received a bill from the consultant-nee-engineer for $50,000.&amp;#160; Shocked, they demanded an explanation and breakdown of this expense.&amp;#160; The engineer responded:&lt;/div&gt;

&lt;div&gt;
  &lt;br /&gt;Piece of Chalk&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $1.00

  &lt;br /&gt;Knowing What To Mark With It&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $49,999.00&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;I’ve always liked that story.&amp;#160; The chalk wasn’t the real value the engineer was brought in to provide, after all.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[1] &lt;em&gt;&lt;a href="http://www.inf.usi.ch/phd/dambros/publications/qsic10.pdf"&gt;On the Impact of Design Flaws on Software Defects&lt;/a&gt;, &lt;/em&gt;D’Ambros, Bacchelli, Lanza&lt;/p&gt;

&lt;p&gt;[2] &lt;em&gt;&lt;a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.43.471&amp;amp;rep=rep1&amp;amp;type=pdf" rel="nofollow"&gt;A Critique of Software Defect Prediction Modules&lt;/a&gt;&lt;/em&gt;, Fenton&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RWlomNc2eKAkCx5FaI4pHKU-aRg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RWlomNc2eKAkCx5FaI4pHKU-aRg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RWlomNc2eKAkCx5FaI4pHKU-aRg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RWlomNc2eKAkCx5FaI4pHKU-aRg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=2l3jsYYNolA:Gh8h6OYq3EA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=2l3jsYYNolA:Gh8h6OYq3EA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=2l3jsYYNolA:Gh8h6OYq3EA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=2l3jsYYNolA:Gh8h6OYq3EA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=2l3jsYYNolA:Gh8h6OYq3EA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=2l3jsYYNolA:Gh8h6OYq3EA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/2l3jsYYNolA" height="1" width="1"/&gt;</description></item><item><title>Getting Started with Code Contracts in VS2010</title><link>http://stevesmithblog.com/blog/getting-started-with-code-contracts-in-vs2010/</link><pubDate>Tue, 17 Aug 2010 17:53:53 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/getting-started-with-code-contracts-in-vs2010/</guid><dc:creator>ssmith</dc:creator><slash:comments>1</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;The idea of &lt;a href="http://en.wikipedia.org/wiki/Design_by_contract" rel="nofollow"&gt;Design By Contract&lt;/a&gt; has been around for quite a while, and Microsoft Research has had a project focused on this topic for several years now, called &lt;a href="http://research.microsoft.com/en-us/projects/specsharp/" rel="nofollow"&gt;Spec#.&lt;/a&gt;&amp;#160; With Visual Studio 2010, there is now support for Code Contracts which are a DevLabs project based on the Spec# project.&amp;#160; You can &lt;a href="http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx" rel="nofollow"&gt;read more about and download Code Contracts for VS2010 here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Once you’ve downloaded and installed Code Contracts, you’ll have a new tab in your VS2010 projects:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/GettingStartedwithCodeContractsinVS2010_C381/SNAGHTML85dce90.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SNAGHTML85dce90" border="0" alt="SNAGHTML85dce90" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/GettingStartedwithCodeContractsinVS2010_C381/SNAGHTML85dce90_thumb.png" width="524" height="448" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;With the Code Contracts installed, you can start to use them in your code in place of things like guard clauses to ensure that a parameter is not null.&amp;#160; The benefit of this approach is that you get a richer experience at design/development time and you can also ensure, via compilation errors, that certain things simply cannot occur in your application.&lt;/p&gt;  &lt;p&gt;Code Contracts uses the notion of PreCondition and PostCondition (among other things) to define what a method expects, and what it claims will be the state of things once it has completed.&amp;#160; As a simple example, consider this method that formats a Customer object and returns a string:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; TextRenderer&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; RenderCustomer(Customer customer)&lt;br /&gt;    {&lt;br /&gt;        Contract.Requires(customer != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;customer must not be null&amp;quot;&lt;/span&gt;);&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; String.Format(&lt;span style="color: #006080"&gt;&amp;quot;{0} - {1}&amp;quot;&lt;/span&gt;, customer.FirstName, customer.LastName);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Note the first line of the method is using Code Contracts (found in System.Diagnostics.Contracts) to state the requirement that the Customer parameter not be null.&amp;#160; With my current settings, this requirement doesn’t cause a compilation error, so I’m able to still build and run my tests that demonstrate that I expect a NullReferenceException from such behavior:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;[TestClass]&lt;br /&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; TextRendererShould&lt;br /&gt;{&lt;br /&gt;    [TestMethod]&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RenderCustomerWithName()&lt;br /&gt;    {&lt;br /&gt;        var customer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Customer() { FirstName = &lt;span style="color: #006080"&gt;&amp;quot;Steve&amp;quot;&lt;/span&gt;, LastName = &lt;span style="color: #006080"&gt;&amp;quot;Smith&amp;quot;&lt;/span&gt; };&lt;br /&gt;        var renderer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextRenderer();&lt;br /&gt;        var result = renderer.RenderCustomer(customer);&lt;br /&gt;&lt;br /&gt;        Assert.AreEqual(&lt;span style="color: #006080"&gt;&amp;quot;Steve - Smith&amp;quot;&lt;/span&gt;, result);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    [TestMethod]&lt;br /&gt;    [ExpectedException(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(NullReferenceException))]&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; BlowUpWithNull()&lt;br /&gt;    {&lt;br /&gt;        var renderer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextRenderer();&lt;br /&gt;        var result = renderer.RenderCustomer(&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;        Assert.AreEqual(&lt;span style="color: #006080"&gt;&amp;quot;Steve - Smith&amp;quot;&lt;/span&gt;, result);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;However, in Visual Studio since I’ve set the project to show squigglies for contract violations, I do see this:&lt;/p&gt;

&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RenderCustomer(null) shows warning." border="0" alt="RenderCustomer(null) shows warning." src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/GettingStartedwithCodeContractsinVS2010_C381/image_3.png" width="449" height="58" /&gt; &lt;/p&gt;

&lt;p&gt;These same warnings are also present in the compiler output, and of course we can choose to treat warnings as errors if we want the build to fail when these rules are violated:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/GettingStartedwithCodeContractsinVS2010_C381/image_5.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/GettingStartedwithCodeContractsinVS2010_C381/image_thumb_1.png" width="527" height="115" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Code Contracts are pretty easy to get started with, and there is support for VS2008 as well as VS2010 so even if you don’t have the latest Visual Studio you may want to check them out.&amp;#160; The documentation is pretty good, too.&amp;#160; &lt;a href="http://download.microsoft.com/download/C/2/7/C2715F76-F56C-4D37-9231-EF8076B7EC13/userdoc.pdf" rel="nofollow"&gt;Read the User Doc PDF&lt;/a&gt; to see more examples of how to get started with Code Contracts to improve the quality of your code today.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_COs3MyG6tqJLek3bn85CVkCQQ8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_COs3MyG6tqJLek3bn85CVkCQQ8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_COs3MyG6tqJLek3bn85CVkCQQ8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_COs3MyG6tqJLek3bn85CVkCQQ8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=pjucp_u2g3A:q-p36gXkG_o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=pjucp_u2g3A:q-p36gXkG_o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=pjucp_u2g3A:q-p36gXkG_o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=pjucp_u2g3A:q-p36gXkG_o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=pjucp_u2g3A:q-p36gXkG_o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=pjucp_u2g3A:q-p36gXkG_o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/pjucp_u2g3A" height="1" width="1"/&gt;</description></item><item><title>Screencast and Podcast Recording Gear</title><link>http://stevesmithblog.com/blog/screencast-and-podcast-recording-gear/</link><pubDate>Sat, 14 Aug 2010 19:42:59 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/screencast-and-podcast-recording-gear/</guid><dc:creator>ssmith</dc:creator><slash:comments>1</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt; I’m working on some screencasts and have had some gear recommended to me that I’m ordering now.&amp;#160; I’ll post back later with an update on how I like these, but if anybody else is interested in what I’ve been told is the best stuff to get, here you go.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Microphone&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="Rode Podcaster USB Dynamic Microphone" href="http://www.amazon.com/gp/product/B000JM46FY?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B000JM46FY"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 10px; display: inline; border-top: 0px; border-right: 0px" title="rode-podcaster" border="0" alt="rode-podcaster" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/ScreencastandPodcastRecordingGear_DD02/rode-podcaster_3.jpg" width="76" height="180" /&gt;&lt;/a&gt;The microphone of choice is the &lt;a href="http://www.amazon.com/gp/product/B000JM46FY?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B000JM46FY"&gt;Rode Podcaster&lt;/a&gt;, pictured at right.&amp;#160; It has a built-in pop filter, so no need to pick up one of those.&amp;#160; This is a USB microphone and doesn’t require any additional boxes or cables.&amp;#160; From the product description:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Seamless integration was the idea, and it was obtained by creating a studio dynamic microphone with unparalleled A/D converters, so that the microphone can be plugged into any computer with no in/out boxes, no expensive pre-amps, just a USB cable. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;em&gt;This is currently &lt;a href="http://www.amazon.com/gp/product/B000JM46FY?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B000JM46FY"&gt;$229 on Amazon&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mount&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="Rode PSM 1 Shockmount for Podcaster" href="http://www.amazon.com/gp/product/B000WA8KYG?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B000WA8KYG"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 10px; display: inline; border-top: 0px; border-right: 0px" title="Rode-shockmount" border="0" alt="Rode-shockmount" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/ScreencastandPodcastRecordingGear_DD02/Rode-shockmount_3.jpg" width="159" height="180" /&gt;&lt;/a&gt; The microphone doesn’t come with anything but, well, the microphone (so I’m told).&amp;#160; So, you need something to stick it to, and that’s where the &lt;a href="http://www.amazon.com/gp/product/B000WA8KYG?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B000WA8KYG"&gt;Rode PSM 1 Shockmount for Podcaster&lt;/a&gt; comes in.&amp;#160; This particular model is:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;…optimized for use with the Rode Podcaster.&amp;#160; Shockmounts prolong the life of your mic and can remove unwanted low frequency rumble.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We definitely don’t want unwanted rumbles, so we’ll throw this into our cart, too ($39).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Stand&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="Rode PSA 1 Swivel Mount Studio Microphone Boom Arm" href="http://www.amazon.com/gp/product/B001D7UYBO?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B001D7UYBO"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="rode-psa1-boom-arm" border="0" alt="rode-psa1-boom-arm" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/ScreencastandPodcastRecordingGear_DD02/rode-psa1-boom-arm_3.jpg" width="127" height="180" /&gt;&lt;/a&gt;People who know things about this stuff tell me that putting a mic on stand directly on your desk (where you’re probably going to be doing some typing) is a BAD PLAN.&amp;#160; Thus, some kind of boom mic stand is a good way to go.&amp;#160; A friend of mine says he actually went the route of going to a music store, picking up a standard floor mount for a mic, and then mounting it upside down from the ceiling.&amp;#160; That sounds amazingly cool, but I’m looking for something a bit more flexible to my office layout, so something I can attach to my desk far away from where I type seems like a good way to go.&amp;#160; Thus, the &lt;a href="http://www.amazon.com/gp/product/B001D7UYBO?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B001D7UYBO"&gt;Rode PSA 1 Swivel Mount Studio Microphone Boom Arm&lt;/a&gt;&amp;#160; looks like a good choice.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Assembly&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I don’t have any of these yet, but when I do I’ll try and update this post with some pictures and/or comments on how it all comes together.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/v0hifqAwCFQkC3OHcsQOaXHOusg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v0hifqAwCFQkC3OHcsQOaXHOusg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/v0hifqAwCFQkC3OHcsQOaXHOusg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v0hifqAwCFQkC3OHcsQOaXHOusg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=9HvMenipwoo:QqXi7mvbJSI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=9HvMenipwoo:QqXi7mvbJSI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=9HvMenipwoo:QqXi7mvbJSI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=9HvMenipwoo:QqXi7mvbJSI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=9HvMenipwoo:QqXi7mvbJSI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=9HvMenipwoo:QqXi7mvbJSI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/9HvMenipwoo" height="1" width="1"/&gt;</description></item><item><title>Books</title><link>http://stevesmithblog.com/blog/books/</link><pubDate>Mon, 26 Jul 2010 21:13:00 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/books/</guid><dc:creator>ssmith</dc:creator><slash:comments>4</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;&lt;a href="http://codinggeekette.com/post/Books-Check-Em-Out!.aspx" rel="nofollow"&gt;Sadukie tagged me with her books post&lt;/a&gt; a couple of weeks ago and I’ve been meaning to respond with a post of my own.&amp;#160; I have a post I update periodically that includes some of my most &lt;a href="http://stevesmithblog.com/blog/favorite-developer-books/"&gt;recommended developer books&lt;/a&gt; (where I’ve been meaning to add &lt;a href="http://www.amazon.com/gp/product/0131857258?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0131857258"&gt;Agile Principles, Patterns, and Practices in C# by Robert and Micah Martin&lt;/a&gt;) – if you’re looking for ways to improve yourself as a software developer I would start there.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Currently Reading&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Right now I’m reading &lt;a href="http://www.amazon.com/gp/product/0345391055?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0345391055"&gt;Disclosure&lt;/a&gt;, by Michael Crichton.&amp;#160; I’m a fan of his stuff, and in the last year I also read &lt;a href="http://www.amazon.com/gp/product/B0017TZKRG?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B0017TZKRG"&gt;Next&lt;/a&gt;, &lt;a href="http://www.amazon.com/gp/product/0061782661?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0061782661"&gt;State of Fear&lt;/a&gt;, and &lt;a href="http://www.amazon.com/gp/product/0451210638?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0451210638"&gt;A Case of Need&lt;/a&gt;.&amp;#160; I’ve also been reading a lot of James Rollins novels (which &lt;a href="http://greatandsmallblog.com/"&gt;Michelle&lt;/a&gt; got me started on), which are good light entertaining reads.&amp;#160; I’ve read &lt;a href="http://www.amazon.com/gp/product/0061965820?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0061965820"&gt;Deep Fathom&lt;/a&gt; and &lt;a href="http://www.amazon.com/gp/product/0060580674?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0060580674"&gt;Sandstorm&lt;/a&gt; and &lt;a href="http://www.amazon.com/gp/product/0061965839?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0061965839"&gt;Amazonia&lt;/a&gt;, and I think my next one is &lt;a href="http://www.amazon.com/gp/product/0060765240?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0060765240"&gt;Map of Bones&lt;/a&gt;, which I’ve not yet started.&amp;#160; Deep Fathom is a good one to start with if you’re so inclined.&amp;#160; The &lt;a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;amp;location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref_%3Dnb%5Fsb%5Fnoss%26fsc%3D-1%26ih%3D12%5F5%5F2%5F0%5F0%5F0%5F0%5F0%5F0%5F1.39%5F74%26y%3D0%26field-keywords%3Dpercy%2520jackson%26url%3Dsearch-alias%253Dus-stripbooks-tree&amp;amp;tag=aspalliancecom&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=39095"&gt;Percy Jackson books&lt;/a&gt;, which I read shortly after my then-7-year-old daughter read, were also fun and entertaining.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Digital Reader&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;My wife got me a Nook for Christmas this past year, and I took it on several trips and loaded it with a few books from the library and PDFs of things I wanted to read later.&amp;#160; It worked pretty well at first, but I have to say I’m not very happy with it at the moment.&amp;#160; It keeps getting into a state where I can’t turn it on or interact with it.&amp;#160; I won’t bore you with the details of all the various rituals I’ve gone through in terms of charging, connecting to AC vs. PC for power, resetting, etc. but suffice to say it’s been rather frustrating (even moreso than trying to get it out of its original packaging, for which there are &lt;a href="http://nookboards.com/2010/01/07/nook-unboxing/" rel="nofollow"&gt;videos to show you how to do it&lt;/a&gt;).&amp;#160; In short, I think I would rather try a Kindle, or maybe even an iPad, in lieu of this device.&amp;#160; The one thing that it has that’s cool, which I’m not sure the other devices support, is grabbing digital books from the local library.&amp;#160; But of course when you can’t get the thing to turn on, the allure of such things fades.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Recommendations&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;One book I really enjoyed reading last year is &lt;a href="http://www.amazon.com/gp/product/0061673730?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0061673730"&gt;Zen and the Art of Motorcycle Maintenance&lt;/a&gt;.&amp;#160; I’ve been meaning to blog about the book and its relationship to Software Craftsmanship (which, by the way, there’s &lt;a href="http://hudsonsc.com/"&gt;a group that meets in Hudson Ohio monthly to improve themselves&lt;/a&gt; in this regard), and hopefully I’ll get that done soon.&amp;#160; However, whether you’re a software developer or not, this is certainly an interesting book to read.&amp;#160; There are some great lessons about &lt;em&gt;quality&lt;/em&gt; that I think are worthwhile for any reader.&lt;/p&gt;  &lt;p&gt;Also, though they’re not books, I highly recommend the web comics &lt;a href="http://xkcd.com/"&gt;XKCD&lt;/a&gt; and &lt;a href="http://calamitiesofnature.com/"&gt;Calamities of Nature&lt;/a&gt; for geeks.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Tag!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So what are you folks reading these days?&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://brendan.enrick.com/" rel="nofollow"&gt;Brendan Enrick&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://scottdepouw.com/" rel="nofollow"&gt;Scott Depouw&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.hanselman.com/blog/" rel="nofollow"&gt;Scott Hanselman&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://scottw.com/" rel="nofollow"&gt;Scott Watermasysk&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/gduthie/" rel="nofollow"&gt;Andrew Duthie&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_d3hPLLREvhN3rxFePp4eWjoVeA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_d3hPLLREvhN3rxFePp4eWjoVeA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_d3hPLLREvhN3rxFePp4eWjoVeA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_d3hPLLREvhN3rxFePp4eWjoVeA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=SEg0_KWZNhY:fqf9QXpEy2w:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=SEg0_KWZNhY:fqf9QXpEy2w:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=SEg0_KWZNhY:fqf9QXpEy2w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=SEg0_KWZNhY:fqf9QXpEy2w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=SEg0_KWZNhY:fqf9QXpEy2w:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=SEg0_KWZNhY:fqf9QXpEy2w:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/SEg0_KWZNhY" height="1" width="1"/&gt;</description></item><item><title>Working with Application Pool Identities</title><link>http://stevesmithblog.com/blog/working-with-application-pool-identities/</link><pubDate>Fri, 09 Jul 2010 13:16:00 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/working-with-application-pool-identities/</guid><dc:creator>ssmith</dc:creator><slash:comments>0</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;There a new feature of IIS called Application Pool Identities that was apparently introduced with SP2 of Windows Server 2008.&amp;#160; There’s a nice overview of &lt;a href="http://learn.iis.net/page.aspx/624/application-pool-identities/" rel="nofollow"&gt;Application Pool Identities here&lt;/a&gt;, which is the basis for this post, which is just my notes on the feature.&lt;/p&gt;  &lt;p&gt;If you’re setting up new web sites and application pools in IIS on Windows Server 2008, it’s likely they’ll default to ApplicationPoolIdentity, like this:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Application Pools" border="0" alt="Application Pools" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/WorkingwithApplicationPoolIdentities_F2DF/image_3.png" width="485" height="216" /&gt; &lt;/p&gt;  &lt;p&gt;This is all well and good, and for the most part you don’t need to care about how this works behind the scenes or why it’s different than the other bazillion different esoteric accounts you’ve had to know about over the last 10 years when setting up IIS for ASP.NET (IUSR_MACHINENAME, NETWORKSERVICE, IUSR, etc.).&amp;#160; The most recent installment in IIS user best practices, before ApplicationPoolIdentity, was NETWORKSERVICE:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;NETWORKSERVICE is a built-in Windows identity. It doesn't require a password and has only user privileges; that is, it is relatively low-privileged.&amp;#160; However, a problem arose over time as more and more Windows system services started to run as NETWORKSERVICE. This is because services running as NETWORKSERVICE can tamper with other services that run under the same identity. Because IIS worker processes run third-party code by default (Classic ASP, ASP.NET, PHP code), it was time to isolate IIS worker processes from other Windows system services and run IIS worker processes under unique identities.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Got that?&amp;#160; The NETWORKSERVICE account was low-privileged, so it was a best practice to use it.&amp;#160; But unfortunately, since so many apps followed this practice, it became likely that NETWORKSERVICE would have too much access to a variety of applications/processes, so something new had to be used.&lt;/p&gt;  &lt;p&gt;Enter Application Pool Identities.&amp;#160; On IIS7.5 on Windows Server 2008 R2, your application pools will run with their own individual identity, each of which is actually a &lt;a href="http://technet.microsoft.com/en-us/library/dd548356.aspx" rel="nofollow"&gt;virtual account&lt;/a&gt; created with the same name as your application pool.&amp;#160; You may see these accounts in the ACLs for the files in your web site, and you’ll need to know how to reference them yourself if you want to configure security settings for your site correctly (e.g. to allow users to upload files to your web application).&amp;#160; &lt;strong&gt;They are not actually users or accounts, so they will not show up as a user in the Windows User Management Console.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;For example, if you look at the Security settings for a particular filesystem object in your web application, you might see something like this:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Security Settings" border="0" alt="Security Settings" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/WorkingwithApplicationPoolIdentities_F2DF/image_6.png" width="356" height="448" /&gt; &lt;/p&gt;  &lt;p&gt;Note, though, that if you go looking for these users on the server, you won’t find them.&amp;#160; If you choose to change permissions by clicking Edit, then Add, then change the location to your server (if it defaults to a domain), then Advanced, and finally Find Now (yes, that’s a lot of buttons), you WON’T SEE THESE ACCOUNTS:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Select Users or Groups" border="0" alt="Select Users or Groups" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/WorkingwithApplicationPoolIdentities_F2DF/image_9.png" width="368" height="416" /&gt; &lt;/p&gt;  &lt;p&gt;So where are they and how do you add them?&lt;/p&gt;  &lt;p&gt;You have to know the secret, which is to prefix Application Pool Identities with &lt;/p&gt;  &lt;p&gt;IIS AppPool\&lt;/p&gt;  &lt;p&gt;Thus to grant rights to the DefaultAppPool you need to use &lt;/p&gt;  &lt;p&gt;IIS AppPool\DefaultAppPool.&amp;#160; &lt;/p&gt;  &lt;p&gt;If your application pool is named mywebsite.com, then your identity would be&lt;/p&gt;  &lt;p&gt;IIS AppPool\mywebsite.com&lt;/p&gt;  &lt;p&gt;When they appear in your ACL list, the IIS AppPool won’t be listed.&amp;#160; This is to ensure greater confusion on your part, because you don’t have enough things to try and remember as a web developer and/or server administrator.&amp;#160; If you type in the correct value and then click Check Names, it will remove the IIS AppPool\ prefix and underline the account name for you, like so:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Before Check Names" border="0" alt="Before Check Names" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/WorkingwithApplicationPoolIdentities_F2DF/image_15.png" width="454" height="235" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="After Check Names" border="0" alt="After Check Names" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/WorkingwithApplicationPoolIdentities_F2DF/image_14.png" width="456" height="244" /&gt; &lt;/p&gt;  &lt;p&gt;Hope this helps! For more info I suggest reading this &lt;a href="http://learn.iis.net/page.aspx/624/application-pool-identities/" rel="nofollow"&gt;article on Application Pool Identities&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Also, don’t forget you can follow me via &lt;a href="http://twitter.com/ardalis"&gt;twitter&lt;/a&gt;, &lt;a href="http://feedburner.google.com/fb/a/mailverify?uri=StevenSmith"&gt;email&lt;/a&gt;, or &lt;a href="http://feeds.feedburner.com/StevenSmith"&gt;RSS&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ey_q2VkWPCvUZSMF6iLGM9bqRXE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ey_q2VkWPCvUZSMF6iLGM9bqRXE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ey_q2VkWPCvUZSMF6iLGM9bqRXE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ey_q2VkWPCvUZSMF6iLGM9bqRXE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=m_CAzJjROwM:Mlb1ZI_4YkY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=m_CAzJjROwM:Mlb1ZI_4YkY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=m_CAzJjROwM:Mlb1ZI_4YkY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=m_CAzJjROwM:Mlb1ZI_4YkY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=m_CAzJjROwM:Mlb1ZI_4YkY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=m_CAzJjROwM:Mlb1ZI_4YkY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/m_CAzJjROwM" height="1" width="1"/&gt;</description></item><item><title>Software Engineering 101 in Cleveland</title><link>http://stevesmithblog.com/blog/software-engineering-101-in-cleveland/</link><pubDate>Wed, 07 Jul 2010 19:34:39 GMT</pubDate><guid isPermaLink="true">http://stevesmithblog.com/blog/software-engineering-101-in-cleveland/</guid><dc:creator>ssmith</dc:creator><slash:comments>0</slash:comments><category domain="http://stevesmithblog.com/blog/">Blog</category><description>&lt;p&gt;Next week I’ll be one of several speakers at a free one-day event being held at the Microsoft office in Independence, Ohio.&amp;#160; The event is designed for Microsoft developers who are seeking to improve their skills in software engineering, including object-oriented design, design patterns, and automated testing.&amp;#160; The event is being hosted by Microsoft and organized by the &lt;a href="http://HudsonSC.com/"&gt;Hudson Software Craftsmanship group&lt;/a&gt; and &lt;a href="http://NimblePros.com/"&gt;NimblePros consulting services&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Initially there were 50 slots available – I think there are about 15-20 left as of today.&amp;#160; The event is scheduled for 16 July 2010 from 830am to 4pm, so if you can get approval to come for some free hands-on training, sign up fast before it’s sold out.&lt;/p&gt;  &lt;p&gt;You can register for the event and view the agenda &lt;a href="http://nimblepros.com/news-and-events/software-engineering-101---cleveland.aspx"&gt;here&lt;/a&gt;.&amp;#160; If you’re planning on attending the Cleveland Give Camp, there will be a number of folks going to both, and the SWE101 event should wrap up in plenty of time to make it to the GiveCamp.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ACv8VDSrZkNrcgcLrz5B_jJ9w6I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ACv8VDSrZkNrcgcLrz5B_jJ9w6I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ACv8VDSrZkNrcgcLrz5B_jJ9w6I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ACv8VDSrZkNrcgcLrz5B_jJ9w6I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=3Dd1vPo8Lig:vK7QzlNfF64:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=3Dd1vPo8Lig:vK7QzlNfF64:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=3Dd1vPo8Lig:vK7QzlNfF64:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=3Dd1vPo8Lig:vK7QzlNfF64:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.stevesmithblog.com/~ff/StevenSmith?a=3Dd1vPo8Lig:vK7QzlNfF64:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StevenSmith?i=3Dd1vPo8Lig:vK7QzlNfF64:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StevenSmith/~4/3Dd1vPo8Lig" height="1" width="1"/&gt;</description></item></channel></rss>
