<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>YTechie.com &#187; software development</title>
	<atom:link href="http://www.ytechie.com/category/software-development/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ytechie.com</link>
	<description>Productive software development using ASP.NET, C#, Adobe Flex, and other technologies and tools.</description>
	<lastBuildDate>Fri, 06 Nov 2009 21:16:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Introduction to Distributed Source Control</title>
		<link>http://www.ytechie.com/2009/11/introduction-to-distributed-source-control.html</link>
		<comments>http://www.ytechie.com/2009/11/introduction-to-distributed-source-control.html#comments</comments>
		<pubDate>Fri, 06 Nov 2009 21:16:21 +0000</pubDate>
		<dc:creator>superjason</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2009/11/introduction-to-distributed-source-control.html</guid>
		<description><![CDATA[Version control systems manage the changes of documents. In software development, their primary purpose is to store the source code for an application, as well as every revision created during its development.
Currently, many developers use a centralized version control system such as Visual Studio Team System (VSTS) or Subversion. With such systems there is a [...]]]></description>
			<content:encoded><![CDATA[<p>Version control systems manage the changes of documents. In software development, their primary purpose is to store the source code for an application, as well as every revision created during its development.</p>
<p>Currently, many developers use a centralized version control system such as Visual Studio Team System (VSTS) or Subversion. With such systems there is a central repository (i.e., Team Foundation Server (TFS)), usually located remotely, that houses the different versions of source code.</p>
<p align="center"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image.png" width="365" height="314" /> </p>
<p>Unfortunately, a number of issues accompany typical source control systems that are based on a centralized repository, including, but not limited to the following:</p>
<ul>
<li>Many operations such as checking code in or out can perform poorly over slow connections. </li>
<li>Working offline results in a reduced set of functionality, such as branching or committing multiple features or bug fixes. </li>
<li>Moving the repository can be difficult due to the fact that there is front-end <b>and</b> back-end management. </li>
<li>Working between networks that may never become bridged is impossible or difficult, since a connection must be made to the central repository. </li>
<li>Private work is typically not under source control. </li>
<li>There is often a single point of failure. </li>
<li>Security must be managed, and may become complex due to multiple permission sets and projects. </li>
</ul>
<p>Distributed source control systems (or distributed version control systems, &quot;DVCS&quot; for short) are starting to gain popularity because they offer many advantages over the traditional, centralized repository.</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image1.png" width="498" height="282" /> </p>
<p>They allow users to work independently in either a connected or disconnected environment. There is a tremendous amount of flexibility in regards to merging, managing different branches of development, and managing product features. </p>
<p>Adopters of this technology include Google Code and Sourceforge. Moreover, many major projects such as GNOME, Perl, MySQL, Python, and Ubuntu are also using a distributed source control system.</p>
<p>You may have already heard about some of the popular implementations. Git, Mercurial, and Bazaar are a few choices that have started to become mainstream. If you&#8217;ve worked with Subversion, you&#8217;ll find that migrating to this new generation of source control systems doesn&#8217;t mean giving up the features that you&#8217;re used to.</p>
<p>There are many problems with centralized repositories that simply disappear when you&#8217;re working with a distributed system:</p>
<ul>
<li>Merging is a core feature and works <i>how</i> and <i>when</i> you want. </li>
<li>Security is trivial since everyone works in their own sandbox. You simply choose who you allow pushing and pulling changes to and from. In open source projects, this typically means allowing certain trusted individuals to push changes to the project repositories. When needed, additional security models such as authentication can be imposed. </li>
<li>Working disconnected doesn&#8217;t require any preparation. You are working offline by default. The only online operation is synchronizing with other repositories. </li>
<li>All operations are near-instantaneous. Synchronizing is the only operation that is dependent on the speed of your connection. </li>
</ul>
<p>&#160;</p>
<p> <b>What is a Distributed Source Control System?</b>
<p>Distributed source control systems have the same purpose, but work much differently than systems like Team Foundation Server (TFS), SourceSafe, Subversion, and CVS. Instead of having a single repository that contains the source code and history, there are many repositories that have the source code, and some or all of its revision history. One or more peers have repositories for a project, and synchronize what they want, when they want to. There are really no requirements or restrictions. The focus is on synchronizing and working independently.</p>
<p><strong>Workflow</strong></p>
<p style="border-bottom: black 2px solid; border-left: black 2px solid; padding-bottom: 4px; background-color: #ffffcc; margin: 5px; padding-left: 4px; padding-right: 4px; border-top: black 2px solid; border-right: black 2px solid; padding-top: 4px">Examples &amp; screenshots included here are from Mercurial using the TortoiseHg explorer extension. Git has similar functionality using TortoiseGit. You can also use the command line for all/some operations if you prefer.</p>
<p>1. <b>Clone a repository</b> &#8211; To create your own local repository, you have to clone (copy) all or part of an existing repository. Since each developer has a copy of the repository, you can clone it from anyone.</p>
<p align="center"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image2.png" width="350" height="427" /> </p>
<p>2. <b>Create a &quot;working copy&quot; of the code</b> &#8211; Even though you have the full repository from another developer, you still need to &quot;check-out&quot; or get the latest version of the code. Since the repository is local, this operation is quick and can be done <b>offline</b>.</p>
<p>3. <b>Make changes</b> &#8211; Simply make any changes you like, without concerning yourself about how your source control works. This is similar to Subversion, and contrasts sharply with TFS which needs to track any changes you make by interfacing with Visual Studio.</p>
<p>4. <b>Check-in changes</b> &#8211; When it&#8217;s time to check in your local changes, they are simply committed to your local repository. They <b>do not affect any other repository</b>. Changes are detected by comparing the newest committed revision with the current version on disk.</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image3.png" width="494" height="216" /> </p>
<p>5. <b>Push or pull changesets</b> &#8211; To actually send your changesets to another repository, you need to &quot;push&quot; or &quot;pull&quot; them. In the Mercurial dialog below, there are options labeled &quot;Incoming&quot; and &quot;Outgoing&quot; which simply compare the local changes with the remote changes and determine what will get pushed or pulled. The &quot;Push&quot; and &quot;Pull&quot; operations send your changesets to another repository, or pull changesets from another repository respectively.</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image4.png" width="480" height="264" /> </p>
<p>When changesets are transferred between repositories, they <b>do not affect any working copies</b>. This flexibility allows changes to be synchronized without affecting work in progress.</p>
<p><b>Online/Offline Operations</b> </p>
<p>
<table style="border-collapse: collapse" border="2" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="143">
<p><b>Operation</b></p>
</td>
<td valign="top" width="167">
<p><b>TFS</b></p>
</td>
<td valign="top" width="166">
<p><b>Subversion</b></p>
</td>
<td valign="top" width="163">
<p><b>Mercurial/GIT/Bazaar</b></p>
</td>
</tr>
<tr>
<td valign="top" width="143">
<p><b>Get/Update</b></p>
</td>
<td style="background-color: red" valign="top" width="167">
<p>Online</p>
</td>
<td style="background-color: red" valign="top" width="166">
<p>Online</p>
</td>
<td style="background-color: green" valign="top" width="163">
<p>Offline</p>
</td>
</tr>
<tr>
<td style="background-color: red" valign="top" width="143">
<p><b>Check-out</b></p>
</td>
<td style="background-color: red" valign="top" width="167">
<p>Online</p>
</td>
<td style="background-color: red" valign="top" width="166">
<p>Online</p>
</td>
<td style="background-color: green" valign="top" width="163">
<p>Offline</p>
</td>
</tr>
<tr>
<td valign="top" width="143">
<p><b>Check-in</b></p>
</td>
<td style="background-color: red" valign="top" width="167">
<p>Online</p>
</td>
<td style="background-color: red" valign="top" width="166">
<p>Online</p>
</td>
<td style="background-color: green" valign="top" width="163">
<p>Offline</p>
</td>
</tr>
<tr>
<td valign="top" width="143">
<p><b>View History</b></p>
</td>
<td style="background-color: red" valign="top" width="167">
<p>Online</p>
</td>
<td style="background-color: red" valign="top" width="166">
<p>Online</p>
</td>
<td style="background-color: green" valign="top" width="163">
<p>Offline</p>
</td>
</tr>
<tr>
<td valign="top" width="143">
<p><b>Revert</b></p>
</td>
<td style="background-color: red" valign="top" width="167">
<p>N/A</p>
</td>
<td style="background-color: green" valign="top" width="166">
<p>Offline</p>
</td>
<td style="background-color: green" valign="top" width="163">
<p>Offline</p>
</td>
</tr>
<tr>
<td valign="top" width="143">
<p><b>Compare working changes</b></p>
</td>
<td style="background-color: red" valign="top" width="167">
<p>Online</p>
</td>
<td style="background-color: green" valign="top" width="166">
<p>Offline</p>
</td>
<td style="background-color: green" valign="top" width="163">
<p>Offline</p>
</td>
</tr>
<tr>
<td valign="top" width="143">
<p><b>Change tracking</b></p>
</td>
<td style="background-color: yellow" valign="top" width="167">
<p>Limited*</p>
</td>
<td style="background-color: green" valign="top" width="166">
<p>Offline</p>
</td>
<td style="background-color: green" valign="top" width="163">
<p>Offline</p>
</td>
</tr>
</tbody>
</table>
<p>* Changes can be made in a special &quot;offline&quot; mode, and edited files will be checked-out when returning to &quot;online&quot; mode.</p>
<p> <b>Merging Divergent Development Branches</b>
<p>In traditional, centralized source control systems, the only way for a divergence in code paths was to explicitly create a branch. While this is still possible in a distributed source control system, it is also possible for multiple developers to make independent changes that may or may not conflict.</p>
<p>The beauty of the system is that divergent code paths can be merged at any time. It is possible for the developers to make multiple changes, perform multiple synchronizations (pulls), yet not have to merge until they want to, or until they need to push their changes to another repository.</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image5.png" width="488" height="179" /> </p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image6.png" width="496" height="279" /> </p>
<p> <b>Where Is My Repository?</b>
<p>If you&#8217;re working with a team of 20 developers, and each one has a full copy of the repository, you don&#8217;t <b><i>need</i></b> a central repository. However, there are a few reasons why it is recommended:</p>
<ol>
<li><b>Central backup location</b> &#8211; Even though you have numerous copies of the repository, it is still useful to have a single location that can be used as a place where an automated backup process is able to find it. </li>
<li><b>Central communication hub</b> &#8211; The logistics of pushing and pulling code between a number of developers can get complicated. Distributing your repository simplifies many of these problems, but is not perfect by itself. Having a central &quot;authoritative&quot; repository can make it quick and easy for developers to collaborate. </li>
<li><b>Central location for builds</b> &#8211; Automated builds and continuous integration servers need a location to pull source code from, which an authoritative repository provides. </li>
<li><b>Central merge location</b> &#8211; If multiple developers are pulling changes from one another, implicit branches can be created. A central repository serves as location where all of these branches are merged into one development line. </li>
</ol>
<p>Repositories can typically be easily hosted internally using Apache, a built in daemon, CGI script, or simply just a file share. For simplicity, there are many services that provide repository hosting. For Git, there is GitHub and SourceForge. For Mercurial, there is BitBucket, Google Code, and SourceForge.</p>
<p>The beauty of distributed source control is apparent when you take into account the administrative overhead of a central server. Since the central server is no different than any other peer, <b>it can be easily moved or modified</b>. For example, you can start out with no central server, then you can use BitBucket to store your revisions, then you can move to another service within minutes. Changing providers simply means pushing your changes to another server.</p>
<p> <b><u>Common Operations</u></b>
<p><strong>Importing Existing Code</strong></p>
<p>Importing existing code is an extremely simple operation. If it is new code that is not yet under source control, you can simply create a new repository within the folder that contains your code. You can then check in your code as desired.</p>
<p style="border-bottom: black 2px solid; border-left: black 2px solid; padding-bottom: 4px; background-color: #ffffcc; margin: 5px; padding-left: 4px; padding-right: 4px; border-top: black 2px solid; border-right: black 2px solid; padding-top: 4px">In Subversion, the import process involved importing the code into the repository, and then checking out a working copy. Mercurial does not have this complexity.</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image7.png" width="407" height="300" /> </p>
<p>Mercurial also comes with built in support for converting existing Subversion repositories to Mercurial repositories, including the entire revision history. <a href="http://www.selenic.com/mercurial/wiki/ConvertExtension" onclick="pageTracker._trackPageview('/outgoing/www.selenic.com/mercurial/wiki/ConvertExtension?referer=');">More information is available here</a>.</p>
<p style="border-bottom: black 2px solid; border-left: black 2px solid; padding-bottom: 4px; background-color: #ffffcc; margin: 5px; padding-left: 4px; padding-right: 4px; border-top: black 2px solid; border-right: black 2px solid; padding-top: 4px">To convert from an older source control system such as Visual Source Safe, you can first <a href="http://www.pumacode.org/projects/vss2svn" onclick="pageTracker._trackPageview('/outgoing/www.pumacode.org/projects/vss2svn?referer=');">convert the repository to Subversion</a>, and then to Mercurial.</p>
<p> <b>&#160;</b> <b>Checking-in Code</b>
<p>It is worth mentioning a typical philosophical difference between how some source control systems promote the check-in process for changes. Systems like TFS and Visual Source Safe only provide <a href="http://msdn.microsoft.com/en-us/library/ms194956(VS.80).aspx" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/ms194956_VS.80_.aspx?referer=');"><b>limited functionality for reverting</b></a> and re-applying specific changesets. For this reason, developers tend to check-in groups of unrelated changes. This tends to lead to less useful generic or incomplete comments such as &quot;done for the day&quot;.</p>
<p>Flexible source control systems such as Subversion, Mercurial, and Git provide a lot more value when changesets are fine-grained, and represent a single change to the system. For example, renaming a page and changing the tab order are two changes that should be checked-in separately. If needed, either feature can be pulled in or out, moved, synchronized, or used to patch other versions. It also reduces the likelihood of conflicts, and typically makes conflict resolution easier. Other developers can quickly scan through the changelog and get a clear list of the features that were added, or bugs that were fixed. In an ideal world, all commits should be tied to a bug or feature to increase traceability.</p>
<p> <b>Managing Branches &amp; Releases</b>
<p>It is simple to create <b>explicit branches</b> that allow you to maintain parallel development of different features or versions. Branching simply involves entering a branch name when you commit your code. Switching between branches is as easy as performing an update to the latest revision of a branch. In contrast, TFS requires a branch to be created before you can commit changes to it. TFS also keeps a copy of each branch on the developers machine, which is optional with Subversion, Mercurial, and others.</p>
<p>Since changes can be made independently, there is also a concept of <b>implicit branching</b>. If we have two users, Ann and Bob, they are free to make changes independently of each other. If Ann checks in her changes, and then Bob pulls down those changes while having changes of his own, there are now two implicit branches of development. In this case <b>pulling</b> changes will automatically create multiple parallel lines of development. Changes cannot be <b>pushed</b> unless the code has been merged. The system is designed this way so that merging is only necessary when pushing, typically to a central repository or build server. The effect is that repositories that are only &quot;pushed to&quot; can be easily and cleanly maintained remotely.</p>
<p>Most distributed source control systems include tools that allow a visual display of code branches. This functionality is also likely to be included in Team Foundation Server 2010.</p>
<p> <b>Tagging Revisions</b>
<p>In order to mark the significance of certain revisions, they can be tagged with a specific label. For example, when you release a specific version of your project, you can tag that revision with the label &quot;v1.2&quot; as seen below. Additional flexibility is provided by the &quot;local tag&quot; functionality, which lets you tag code on your computer without sharing the tag with others.</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/11/image8.png" width="381" height="296" /> </p>
<p> <b>Terminology</b>
<p><b>Distributed Version Control System (DVCS)</b> &#8211; Version control systems manage the changes of documents. In software development, their primary purpose is to store the source code for an application, as well as every revision created during its development.</p>
<p><b>Repository</b> &#8211; A container for a set of changes that represent the history of the source code for a project. A repository may have the ability to store a partial history of the project, or the entire history. The repository is typically optimized by using compression and by only storing deltas or changes of files.</p>
<p><b>Changeset/Revision</b> &#8211; A particular &quot;delta&quot; or change in the codebase. This can include any type of change, in any number of files. Visual Source Safe stored revision numbers for each file. Team Foundation Server and Subversion have global revision numbers for the entire repository. Distributed source control systems often use GUID&#8217;s or hash codes to represent specific revisions.<b></b></p>
<p><b>Working copy</b> &#8211; A particular revision of the code that has been extracted or checked out from the repository. This revision includes the full version of all the files involved so that the developer can load and make changes to the code.</p>
<p><b>Bundle</b> &#8211; A bundle is a file that contains a set of changes that is intended to be sent to another user to update their repository. This technology allows users to be physically disconnected yet pass code changes to each other. This file typically employs some form of compression to minimize file size.</p>
<p><b>Patch/diff</b> &#8211; A patch is a file that shows the changes between two versions of a file or multiple files. It contains enough information to transform the old version into the new version, or vice-versa. It&#8217;s a quick way of sending someone a changeset. Patches are usually in the &quot;unified diff&quot; format, which looks like the following:</p>
<pre style="border-bottom: black 2px solid; border-left: black 2px solid; padding-bottom: 4px; background-color: lightgrey; margin: 5px; padding-left: 4px; padding-right: 4px; border-top: black 2px solid; border-right: black 2px solid; padding-top: 4px">--- /path/to/original timestamp
+++ /path/to/new      timestamp
@@ -1,3 +1,9 @@
+This is an important
+notice! It should
+therefore be located at
+the beginning of this
+document!
+
 This part of the
 document has stayed the
 same from version to
@@ -5,16 +11,10 @@
 be shown if it doesn't
 change.  Otherwise, that
 would not be helping to
-compress the size of the
-changes.
-
-This paragraph contains
-text that is outdated.
-It will be deleted in the -near future.
+compress anything. 

 It is important to spell
-check this dokument. On
+check this document. On
 the other hand, a
 misspelled word isn't
 the end of the world.
@@ -22,3 +22,7 @@
 this paragraph needs to
 be changed. Things can
 be added after it.
+
+This paragraph contains
+important new additions
+to this document. </pre>
<h4>&#160;</h4>
<h4>References</h4>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms194956(VS.80).aspx" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/ms194956_VS.80_.aspx?referer=');">http://msdn.microsoft.com/en-us/library/ms194956(VS.80).aspx</a> </li>
<li><a href="http://www.pumacode.org/projects/vss2svn" onclick="pageTracker._trackPageview('/outgoing/www.pumacode.org/projects/vss2svn?referer=');">http://www.pumacode.org/projects/vss2svn</a> </li>
<li><a href="http://www.selenic.com/mercurial/wiki/PublishingRepositories" onclick="pageTracker._trackPageview('/outgoing/www.selenic.com/mercurial/wiki/PublishingRepositories?referer=');">http://www.selenic.com/mercurial/wiki/PublishingRepositories</a> </li>
<li><a href="http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/" onclick="pageTracker._trackPageview('/outgoing/betterexplained.com/articles/intro-to-distributed-version-control-illustrated/?referer=');">http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/</a> </li>
<li><a href="http://code.google.com/p/tortoisegit/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/tortoisegit/?referer=');">http://code.google.com/p/tortoisegit/</a> </li>
<li><a href="http://bitbucket.org/tortoisehg/stable/wiki/Home" onclick="pageTracker._trackPageview('/outgoing/bitbucket.org/tortoisehg/stable/wiki/Home?referer=');">http://bitbucket.org/tortoisehg/stable/wiki/Home</a> </li>
<li><a href="http://msmvps.com/blogs/vstsblog/archive/2008/08/17/how-microsoft-uses-team-foundation-server-internally.aspx" onclick="pageTracker._trackPageview('/outgoing/msmvps.com/blogs/vstsblog/archive/2008/08/17/how-microsoft-uses-team-foundation-server-internally.aspx?referer=');">http://msmvps.com/blogs/vstsblog/archive/2008/08/17/how-microsoft-uses-team-foundation-server-internally.aspx</a> </li>
<li><a href="http://blogs.msdn.com/bharry/archive/2007/09/15/update-on-microsoft-tfs-adoption.aspx" onclick="pageTracker._trackPageview('/outgoing/blogs.msdn.com/bharry/archive/2007/09/15/update-on-microsoft-tfs-adoption.aspx?referer=');">http://blogs.msdn.com/bharry/archive/2007/09/15/update-on-microsoft-tfs-adoption.aspx</a> </li>
<li><a href="http://blogs.msdn.com/bharry/archive/2008/09/15/september-08-devdiv-tfs-dogfood-statistics.aspx" onclick="pageTracker._trackPageview('/outgoing/blogs.msdn.com/bharry/archive/2008/09/15/september-08-devdiv-tfs-dogfood-statistics.aspx?referer=');">http://blogs.msdn.com/bharry/archive/2008/09/15/september-08-devdiv-tfs-dogfood-statistics.aspx</a> </li>
</ul>
<p><b>Recommended Reading</b> </p>
<ul>
<li><a href="http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/" onclick="pageTracker._trackPageview('/outgoing/betterexplained.com/articles/intro-to-distributed-version-control-illustrated/?referer=');">Illustrated introduction to distributed version control</a> </li>
<li><a href="http://www.selenic.com/mercurial/wiki/QuickStart" onclick="pageTracker._trackPageview('/outgoing/www.selenic.com/mercurial/wiki/QuickStart?referer=');">Mercurial QuickStart</a> </li>
<li><a href="http://hgbook.red-bean.com/read/" onclick="pageTracker._trackPageview('/outgoing/hgbook.red-bean.com/read/?referer=');">Mercurial: The Definitive Guide</a> </li>
<li><a href="http://bitbucket.org/tortoisehg/stable/wiki/install" onclick="pageTracker._trackPageview('/outgoing/bitbucket.org/tortoisehg/stable/wiki/install?referer=');">TortoiseHg Download</a> </li>
<li><a href="http://code.google.com/p/support/wiki/DVCSAnalysis" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/support/wiki/DVCSAnalysis?referer=');">Google&#8217;s Analysis of Git vs Mercurial</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2009/11/introduction-to-distributed-source-control.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Common Pitfalls when working with DateTime&#8217;s</title>
		<link>http://www.ytechie.com/2009/06/common-pitfalls-when-working-with-datetimes.html</link>
		<comments>http://www.ytechie.com/2009/06/common-pitfalls-when-working-with-datetimes.html#comments</comments>
		<pubDate>Tue, 02 Jun 2009 19:05:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2009/06/common-pitfalls-when-working-with-datetimes.html</guid>
		<description><![CDATA[In .NET, the DateTime structure provides us wonderful functionality, but this seemingly simple structure can cause a lot of headaches if you don’t fully understand how to use it properly.
 
Understand the terminology
First, UTC, GMT, and even Zulu time are all the same thing. They’re basically a universal time clock that is not subject to [...]]]></description>
			<content:encoded><![CDATA[<p>In .NET, the <a href="http://msdn.microsoft.com/en-us/library/system.datetime.aspx" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/system.datetime.aspx?referer=');">DateTime</a> structure provides us wonderful functionality, but this seemingly simple structure can cause a lot of headaches if you don’t fully understand how to use it properly.</p>
<p align="center"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Clock" border="0" alt="Clock" src="http://www.ytechie.com/post-images/2009/06/clock.jpg" width="244" height="163" /> </p>
<p><strong>Understand the terminology</strong></p>
<p>First, UTC, GMT, and even Zulu time are all the same thing. They’re basically a universal time clock that is not subject to changes in time zones or time changes. Each tick of the universal clock represents a moment in our perception of time. </p>
<p><strong>Use UTC as long as possible</strong></p>
<p><strong>UTC</strong> is very useful when developing software because it removes the need to know where the time was from, or where it’s going to be used. We don’t even care <em>when</em> it was from, or <em>when</em> we’re displaying it. You can think of your <strong>local</strong> clock as a view of the time right now, where you are. It has already taken into account the time zone and daylight savings time.</p>
<p>These properties of your local clock suggest that we should always convert from the local clock to universal time as early as possible when accepting user input, and convert it back to the users time only when displaying it. This is a simple, easy to use pattern that may be enough to avoid some of the potential problems that other projects face. This pattern will give you the ability to cope with time changes and time zones much more easily.</p>
<p>Converting between local time and UTC is pretty easy. <a href="http://msdn.microsoft.com/en-us/library/system.datetime.tolocaltime.aspx" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/system.datetime.tolocaltime.aspx?referer=');">ToLocalTime</a> will convert from universal time to local time. <a href="http://msdn.microsoft.com/en-us/library/system.datetime.touniversaltime.aspx" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/system.datetime.touniversaltime.aspx?referer=');">ToUniversalTime</a> will convert to UTC. Just be aware that these methods have a certain amount of logic in them that only has the rules that were in effect when they were written. They are not perfect for all scenarios. You’ll also want to take a look at the <a href="http://msdn.microsoft.com/en-us/library/system.datetime.touniversaltime.aspx" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/system.datetime.touniversaltime.aspx?referer=');">Kind</a> property, which affects which conversions you can perform, as well as providing a nice way to keep track of whether or not he time has been adjusted to UTC.</p>
<p><strong>Daylight Savings Time &amp; Time Changes</strong></p>
<p>Every year in many parts of the world, the time changes. Apparently the idea is to save gobs of money by using the sunlight more efficiently instead of using artificial lights. Unfortunately, this really sucks for software developers.</p>
<p>I used to write software for manufacturing facilities that would run during a time change. If you have software that records and time-sensitive data during a time change, your software had better be prepared to handle it the fact that one hour is skipped, and another is repeated. Storing the data in UTC solves part of the problem. Unfortunately, when you try to display the data you’ll have an hour of missing data, and a hour with overlapping data. <strong>You may have to design your user interface to deal with this</strong>.</p>
<p><strong>Fixed-time Appointments</strong></p>
<p>Unfortunately, UTC doesn’t solve all of our time offset problems. Let’s say that you have an appointment that you’re scheduling for a future date that occurs when DST is in effect, but it’s not in effect right now. You choose 5:00am for your appointment time. Your application happily converts the time to UTC, and the reverse process expectedly yields the same result. The problem is, the time offset when the appointment occurs will be different than it is now. Daylight savings for the central time zone for example, switches between and offset of –5 and –6. This diagram attempts to visualize:</p>
<p align="center">&#160;<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="DST DateTime Diagram" border="0" alt="DST DateTime Diagram" src="http://www.ytechie.com/post-images/2009/06/image.png" width="476" height="260" /> </p>
<p>What we want to store is the fact that our appointment occurs at <strong>5:00am local time</strong>. If we simply store the information as UTC, we’re losing this additional information. When we switch to <strong>non-DST</strong> time and use our current time adjustment of <strong>–6 hours</strong>, our appointment now occurs at <strong>4:00am</strong>.</p>
<p>If you’re writing an application that stores fixed-time appointments as well as appointments that are designed to have even intervals (exactly 1 month apart, etc) or occur in a different time zone or DST, you’ll need to store an additional flag with the event so you can make the determination if it needs to be adjusted.</p>
<p><strong>Conclusion</strong></p>
<p>Times can be complicated depending on the requirements of your project. It would be unwise to work these problems out toward the end of a project, because the consistency of usage can’t be guaranteed. Do yourself a favor and plan ahead for these issues, and it will be much easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2009/06/common-pitfalls-when-working-with-datetimes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Practical .NET Unit Testing &#8211; Free paper released</title>
		<link>http://www.ytechie.com/2009/04/practical-net-unit-testing-free-paper-released.html</link>
		<comments>http://www.ytechie.com/2009/04/practical-net-unit-testing-free-paper-released.html#comments</comments>
		<pubDate>Thu, 30 Apr 2009 13:04:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2009/04/practical-net-unit-testing-free-paper-released.html</guid>
		<description><![CDATA[I’ve been working on a unit testing paper that sums up my experience in unit testing, and discusses some of the core information that I feel is important about the subject. It’s very much a work in progress, but I wanted to get it out sooner rather than later. I’ll be continuously updating it as [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been working on a unit testing paper that sums up my experience in unit testing, and discusses some of the core information that I feel is important about the subject. It’s very much a work in progress, but I wanted to get it out sooner rather than later. I’ll be continuously updating it as time goes on.</p>
<p><strong>Update: I updated the <a href="http://downloads.ytechie.com/Practical_.NET_Unit_Testing.pdf" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/downloads.ytechie.com/Practical_.NET_Unit_Testing.pdf?referer=');">PDF location</a> to one that doesn&#8217;t require registration.</strong></p>
<p align="center"><a href="http://downloads.ytechie.com/Practical_.NET_Unit_Testing.pdf" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/downloads.ytechie.com/Practical_.NET_Unit_Testing.pdf?referer=');"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Practical .NET Unit Testing" border="0" alt="Practical .NET Unit Testing" src="http://www.ytechie.com/post-images/2009/05/image.png" width="392" height="203" /></a></p>
<p align="left">There are some really great books out there about unit testing, but I think some of them are trying too hard to be long enough to be considered a “book”. I set out to create a document that fills the gap between the various snippets of information from blog posts, and the comprehensive books on the subject. If you’re interested in something a bit more in-depth, here are some great books on the subject:</p>
<ul>
<li>
<div><a href="http://www.amazon.com/gp/product/1933988274?ie=UTF8&amp;tag=ytechie-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=1933988274" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.amazon.com/gp/product/1933988274?ie=UTF8_amp_tag=ytechie-20_amp_linkCode=xm2_amp_camp=1789_amp_creativeASIN=1933988274&amp;referer=');">The Art of Unit Testing by Roy Osherove</a></div>
</li>
<li>
<div><a href="http://www.amazon.com/gp/product/0131495054?ie=UTF8&amp;tag=ytechie-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=0131495054" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.amazon.com/gp/product/0131495054?ie=UTF8_amp_tag=ytechie-20_amp_linkCode=xm2_amp_camp=1789_amp_creativeASIN=0131495054&amp;referer=');">xUnit Test Patterns by Gerard Meszaros</a></div>
</li>
</ul>
<p>The paper currently consists of 5 main sections:</p>
<ul>
<li>Why Write Unit Tests? </li>
<li>Unit Test Mechanics </li>
<li>Common Unit Testing Strategies </li>
<li>Designing for Testability </li>
<li>Advanced Techniques </li>
</ul>
<p>Here is a more complete snapshot of the current outline:</p>
<ul>
<li>Introduction </li>
<li>Unit Testing &amp; Managers </li>
<li>What Unit Tests Really Do </li>
<li>Types of Testing </li>
<li>Testing Framework </li>
<li>Test Runner </li>
<li>Unit Test Structure </li>
<li>Other Test Attributes </li>
<li>What is Refactoring? </li>
<li>Test Driven Development </li>
<li>Evolving Code </li>
<li>When Should You Write Unit Tests? </li>
<li>Test is for Functionality, Not Code! </li>
<li>The Constraints of Reality </li>
<li>Interfaces &#8211; Quick Overview </li>
<li>Using a Mocking Framework </li>
<li>Stubs </li>
<li>The Test Driven Design Paradox </li>
<li>Testing Under Pressure </li>
<li>Extracting Duplicate Logic </li>
<li>Modular Design Benefits </li>
</ul>
<p>So what are you waiting for? <a href="http://www.scribd.com/doc/14713003/Practical-NET-Unit-Testing" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.scribd.com/doc/14713003/Practical-NET-Unit-Testing?referer=');">Go check it out online instantly</a>, you can even <a href="http://downloads.ytechie.com/Practical_.NET_Unit_Testing.pdf" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/downloads.ytechie.com/Practical_.NET_Unit_Testing.pdf?referer=');">download it as a PDF</a> if you like. Is anything missing? Is anything just plain wrong? I’d love to hear your feedback.</p>
<p>Remember, if you want to hear more about unit testing, <a href="http://www.ytechie.com/2009/04/speaking-at-day-of-net-at-fox-valley-tech.html">I’ll be speaking in Northeast Wisconsin Saturday, May 9th</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2009/04/practical-net-unit-testing-free-paper-released.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Speaking at Day of .NET at Fox Valley Tech</title>
		<link>http://www.ytechie.com/2009/04/speaking-at-day-of-net-at-fox-valley-tech.html</link>
		<comments>http://www.ytechie.com/2009/04/speaking-at-day-of-net-at-fox-valley-tech.html#comments</comments>
		<pubDate>Tue, 28 Apr 2009 14:54:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2009/04/speaking-at-day-of-net-at-fox-valley-tech.html</guid>
		<description><![CDATA[If you’re interested in hearing about writing practical unit tests in .NET, I’ll be speaking at the Fox Valley .NET user group “Day of .NET” event May 9th! Here is the synopsis for your reading pleasure:
Want to learn how to write good automated unit tests that are beneficial both to the product/customer and to you [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re interested in hearing about writing practical unit tests in .NET, I’ll be speaking at the <a href="http://fvnug.org" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/fvnug.org?referer=');">Fox Valley .NET user group</a> <a href="http://fvnug.org/dnn/DayOfNet/Schedule/tabid/62/Default.aspx" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/fvnug.org/dnn/DayOfNet/Schedule/tabid/62/Default.aspx?referer=');">“Day of .NET” event</a> May 9th! Here is the synopsis for your reading pleasure:</p>
<blockquote><p>Want to learn how to write good automated unit tests that are beneficial both to the product/customer and to you as a developer? See an overview of the mechanics of unit testing including the tools and frameworks available. You&#8217;ll see examples of how to test existing code, but you&#8217;ll also see practical examples of how seemingly un-testable code can be designed so that it can be tested with ease. Learn how test driven development and refactoring will improve the readability of your code, minimize debugging, and speed up development.</p>
</blockquote>
<p><a href="http://fvnug.org" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/fvnug.org?referer=');"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.ytechie.com/post-images/2009/04/image5.png" width="490" height="79" /></a> </p>
<p>If you’re anywhere near the Northeast Wisconsin area, stop in. It’s free!</p>
<p>I’ll be publishing both the presentation and a supporting 25+ page paper shortly, so make sure you’re <a href="http://feedproxy.google.com/Ytechie" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/feedproxy.google.com/Ytechie?referer=');">subscribed to my feed</a>.</p>
<p><a href="http://www.fvtc.edu/public/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.fvtc.edu/public/?referer=');">Fox Valley Tech</a> is located at:     <br /><a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=1825+N.+Bluemound+Drive,+Appleton+WI&amp;sll=37.0625,-95.677068&amp;sspn=1.468445,2.771301&amp;ie=UTF8&amp;z=15&amp;msa=0&amp;msid=107741674408312530799.000001120068a94c2e438" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/maps.google.com/maps?f=q_amp_source=s_q_amp_hl=en_amp_geocode=_amp_q=1825+N.+Bluemound+Drive_+Appleton+WI_amp_sll=37.0625_-95.677068_amp_sspn=1.468445_2.771301_amp_ie=UTF8_amp_z=15_amp_msa=0_amp_msid=107741674408312530799.000001120068a94c2e438&amp;referer=');">1825 N. Bluemound</a>     <br />Appleton, WI 54912</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2009/04/speaking-at-day-of-net-at-fox-valley-tech.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Maintaining Consistent Line Lengths</title>
		<link>http://www.ytechie.com/2009/04/maintaining-consistent-line-lengths.html</link>
		<comments>http://www.ytechie.com/2009/04/maintaining-consistent-line-lengths.html#comments</comments>
		<pubDate>Mon, 06 Apr 2009 14:10:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2009/04/maintaining-consistent-line-lengths.html</guid>
		<description><![CDATA[Today&#8217;s tip comes from the “Anally Retentive” department. In the .NET CLR team likes to keep their lines of code under 110 characters long. I’m assuming that they’re trying to maintain consistency and readability. I often try to maintain an imaginary line length limit, but I doubt I’m very consistent.
 
Fortunately, Visual Studio provides a [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s tip comes from the “Anally Retentive” department. In the <a href="http://blogs.msdn.com/shawnfa/archive/2006/07/07/659281.aspx" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/blogs.msdn.com/shawnfa/archive/2006/07/07/659281.aspx?referer=');">.NET CLR team likes to keep their lines of code under 110 characters long</a>. I’m assuming that they’re trying to maintain consistency and readability. I often try to maintain an imaginary line length limit, but I doubt I’m very consistent.</p>
<p><img title="Vertical line in Visual Studio" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="272" alt="Vertical line in Visual Studio" src="http://www.ytechie.com/post-images/2009/04/image.png" width="483" border="0" /> </p>
<p>Fortunately, Visual Studio provides a hidden feature that lets you draw a vertical line in the text editor to show you where a certain line length would end. Fire up your registry editor and find this key:</p>
<p><strong>HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor</strong></p>
<p>If you’re using a version of Visual Studio before 2008, you’ll need to decrement the 9.0 version number in the path above.</p>
<p>Then, add the following value (as a string or REG_SZ) with the name of “<strong>Guides</strong>”:</p>
<p><strong>RGB(192,192,192) 110</strong></p>
<p>The first part is the color, and the second part is the line length. Personally, I use a line length of 110 to stay consistent with how Microsoft has chosen to do it. I like the color listed above because it’s faint, but visible. Since the line is almost impossible to see in the screenshot above, here is an un-scaled screenshot of the line itself:</p>
<p align="center"><img title="Vertical Line" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="68" alt="Vertical Line" src="http://www.ytechie.com/post-images/2009/04/image1.png" width="213" border="0" /> </p>
<p align="left">To further enforce the 110 character limit, you could also resize the code portion of your Visual Studio window so that it’s near the line. This will make the line itself a little less annoying, while allowing you to use the rest of the window for other information. For example, take a look at how much room I have on a 1920&#215;1200 screen when I horizontally resize my code window:</p>
<p align="left"><img title="Utilizing a large monitor in Visual Studio" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="291" alt="Utilizing a large monitor in Visual Studio" src="http://www.ytechie.com/post-images/2009/04/image2.png" width="467" border="0" />&#160;</p>
<p align="left">Obviously this tip isn’t for everyone. You may be working with legacy code with long lines, or you might work on a team that doesn’t mind long lines. The great news is that Visual Studio is pretty accommodating to however you like to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2009/04/maintaining-consistent-line-lengths.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Is Quality Important?</title>
		<link>http://www.ytechie.com/2009/02/is-quality-important.html</link>
		<comments>http://www.ytechie.com/2009/02/is-quality-important.html#comments</comments>
		<pubDate>Tue, 10 Feb 2009 16:50:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2009/02/is-quality-important.html</guid>
		<description><![CDATA[Joel Spolsky and Jeff Atwood stirred up some debate when they said “Quality just doesn’t matter that much”. At first, I was a little outraged. My entire development process is built around quality. Without it, airplanes would fall from the sky and your car wouldn’t start in the morning.
 
So can we definitively put the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.joelonsoftware.com/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.joelonsoftware.com/?referer=');">Joel Spolsky</a> and <a href="http://www.codinghorror.com/blog/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.codinghorror.com/blog/?referer=');">Jeff Atwood</a> <a href="http://blog.objectmentor.com/articles/2009/01/31/quality-doesnt-matter-that-much-jeff-and-joel" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/blog.objectmentor.com/articles/2009/01/31/quality-doesnt-matter-that-much-jeff-and-joel?referer=');">stirred up some debate</a> when they said “<em>Quality just doesn’t matter that much</em>”. At first, I was a little outraged. My entire development process is built around quality. Without it, airplanes would fall from the sky and your car wouldn’t start in the morning.</p>
<p><a href="http://www.ytechie.com/post-images/2009/02/levelsofquality.jpg"><img title="Levels-of-Quality" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="164" alt="Levels-of-Quality" src="http://www.ytechie.com/post-images/2009/02/levelsofquality-thumb.jpg" width="244" border="0" /></a> </p>
<p>So can we definitively put the quality question to rest? Unfortunately, “No”.</p>
<p>First of all, we need to understand that quality isn’t a Boolean. It’s not “yes”, you have quality, or “no”, you don’t have quality. Quality is a gradient, but it’s even worse than that. Everyone sees it differently, and everyone experiences a different aspect of it. In short, quality is a multidimensional gradient!</p>
<p>I used to work at a small development company where I worked very closely with the President of that company. He was concerned with quality, but that took a backseat to the features that went into the product. The features themselves sold the product, and wowed the people writing the checks. Once they purchased our software, the integration efforts were large enough that the customer was essentially locked-in. Throw an expensive support contract into the mix, and it was a money making machine.</p>
<p>The company ended up being very successful, and was eventually assimilated by a huge company. The owners ended up walking away with a few million each. Try to explain to them that quality is more important than features!</p>
<p>Now fast-forward a few years, and we can examine what eventually happened. The product did work, and honestly it was the best in its class simply due to the scope of the problems it was trying to solve, and the high barrier of entry for competitors. However, the quality issues eventually caught up with the product. It became difficult to maintain and add extra features. The only solution was to slowly rewrite sections of it.</p>
<p>I think a great analogy is the turtle and the hare. If you’re in for the long haul, you want to be the steady turtle. If you’re in it for the short term, you want to be as quick as possible, even at the cost of stopping to nap. The problem is, you’re making others suffer for your negligence.</p>
<p>If you want the best of both worlds, <strong>build quality into your development process</strong>. I’ll be covering this in a series of articles that discuss unit testing (and testing in general) in exhaustive detail. They should be coming out by the middle of March. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2009/02/is-quality-important.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t lose your code &#8211; 3 methods that can help</title>
		<link>http://www.ytechie.com/2009/01/dont-lose-your-code-3-methods-that-can-help.html</link>
		<comments>http://www.ytechie.com/2009/01/dont-lose-your-code-3-methods-that-can-help.html#comments</comments>
		<pubDate>Mon, 05 Jan 2009 14:20:28 +0000</pubDate>
		<dc:creator>superjason</dc:creator>
				<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2009/01/dont-lose-your-code-3-methods-that-can-help.html</guid>
		<description><![CDATA[Inevitably, you&#8217;ll lose power to your computer, have a hard drive crash, have lightening strike, accidentally delete code that hasn&#8217;t been checked in, or encounter some other crazy scenario that I can&#8217;t even imagine. What is your plan? Read on if you want some solutions that may just save your ass code.
 
I&#8217;ve had it [...]]]></description>
			<content:encoded><![CDATA[<p>Inevitably, you&#8217;ll lose power to your computer, have a hard drive crash, have lightening strike, accidentally delete code that hasn&#8217;t been checked in, or encounter some other crazy scenario that I can&#8217;t even imagine. What is your plan? Read on if you want some solutions that may just save your <strike>ass</strike> code.</p>
<p align="center"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="163" alt="Did I just delete that code?" src="http://www.ytechie.com/post-images/2009/01/istock-000002512608xsmall.jpg" width="244" border="0"/> </p>
<p>I&#8217;ve had it happen to me, I accidentally deleted hours of work and had to spend the time to rewrite the code. I even remember a time while working at my first job that the power went out to our whole building. At the time, most computers were desktop machines without a UPS. It was seconds after the lights went out that I heard an agonizing moan from one of the offices. Another developer hadn&#8217;t saved often enough and lost everything he was working on.</p>
<p><strong>Use a automated screenshot tool</strong></p>
<p>For the past few months, I&#8217;ve been using a product called <a href="http://www.timesnapper.com/" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.timesnapper.com/?referer=');">TimeSnapper</a>. Basically, it takes a screenshot of your desktop every few seconds. I have mine set up to the default of taking a snapshot every 10 seconds.</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="180" alt="TimeSnapper Options" src="http://www.ytechie.com/post-images/2009/01/image.png" width="185" border="0"/> <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="181" alt="TimeSnapper Day View" src="http://www.ytechie.com/post-images/2009/01/image1.png" width="284" border="0"/> </p>
<p>You can store the screenshots as standard image files such as PNG or JPG. You can optionally encrypt the images so that they can only be viewed with the correct encryption key.</p>
<p>Usually one of the first concerns with this backup method is that the image files take up a fair amount of space. Luckily, there are a few ways to optimize the screenshots. Below are the options that I use personally. I use a high level of compression for the images, and only capture the window that has focus. These settings work well with my goal of being able to read the code that was displayed on my screen at any given time.</p>
<p align="center"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="205" alt="Image Quality Options" src="http://www.ytechie.com/post-images/2009/01/image2.png" width="472" border="0"/> </p>
<p>I honestly can&#8217;t recommend this product enough. It&#8217;s well worth the $25 price tag. Its not only saved me from losing valuable code, but I&#8217;ve even used it to lookup information that I found on the web but can&#8217;t relocate.</p>
<p>Here is partial list of features to get you salivating:</p>
<ul>
<li>Play your day back like a movie &#8211; Watch your entire day in minutes, or quickly scan a time range to find code that may have been deleted.</li>
<li>Track productivity by telling it which programs should count as &#8220;productive&#8221;.</li>
<li>View reports on how long each type of application is used. Not necessarily useful, but interesting nonetheless.</li>
<li>Flag sections to associate them with other items such as work items in a bug tracking system.</li>
<li>Filter by application &#8211; You can configure it to track only Visual Studio for example.</li>
</ul>
<p><strong>Use a keylogger</strong></p>
<p>The next option has the advantage of being a little more lightweight, but may not offer the same level of code protection as using a screenshot tool. Basically, you install a keylogger that will record every keystroke that you make.</p>
<p>When I first had the idea to use a keylogger, I discovered that there are a number of legitimate keyloggers out there. Apparently, book authors frequently use keyloggers to save their work.</p>
<p>You have two options for the type of keylogger you can use. You can use a <a href="http://www.keyghost.com/USB-Keylogger.htm" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.keyghost.com/USB-Keylogger.htm?referer=');">hardware solution</a> that plugs into your computer on one end, and the mouse plugs into the other. The other option is to use a software keylogger such as <a href="http://sourceforge.net/projects/pykeylogger/" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/sourceforge.net/projects/pykeylogger/?referer=');">PyKeylogger</a> (open source, free).</p>
<p>The biggest problem with keyloggers is that they store the information as you originally typed it, not as it is in your code files. That means that if you&#8217;re jumping between files, or making a lot of edits or corrections, the key log won&#8217;t be of much use to you.</p>
<p>Most keyloggers do allow you to encrypt the recorded information so that your passwords and other sensitive information are fairly safe.</p>
<p><strong>Automate code backups</strong></p>
<p>There are a number of automated backup tools that will run scheduled backups of your local files. Personally, I like offsite backups for smaller files because they&#8217;re portable. I use a product called <a href="http://www.ytechie.com/2008/07/new-backup-solution-jungledisk-amazon-s3.html" target="_blank">JungleDisk, which I&#8217;ve mentioned before</a>. I have it set up to backup my code every 15 minutes. It minimizes my potential loss of work to 15 minutes at most.</p>
<p align="center"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="254" alt="JungleDisk Backup Selection" src="http://www.ytechie.com/post-images/2009/01/image3.png" width="337" border="0"/> </p>
<p>If you frequently work on a specific network with access to a secure file share, you can also automate network backups. Windows Vista actually comes with a <a href="http://en.wikipedia.org/wiki/Robocopy" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Robocopy?referer=');">sophisticated file copy tool that supports quick differential copies</a>. Keep in mind that if you&#8217;re not connected to the network, you won&#8217;t have any protection against lost code at all.</p>
<p><strong>Conclusion</strong></p>
<p>I&#8217;ve given you a few ways that you can protect your precious code (in addition to your source control system of course). Personally, I use a combination of JungleDisk and TimeSnapper. Between the two, I could potentially lose a maximum of 15 minutes of work, and in most cases, I won&#8217;t lose ANY work. Can you say the same thing?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2009/01/dont-lose-your-code-3-methods-that-can-help.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Advantages of a 3rd party diff/compare tool</title>
		<link>http://www.ytechie.com/2008/12/advantages-of-a-3rd-party-diffcompare-tool.html</link>
		<comments>http://www.ytechie.com/2008/12/advantages-of-a-3rd-party-diffcompare-tool.html#comments</comments>
		<pubDate>Fri, 26 Dec 2008 15:23:57 +0000</pubDate>
		<dc:creator>superjason</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2008/12/advantages-of-a-3rd-party-diffcompare-tool.html</guid>
		<description><![CDATA[I recently spent nearly an hour trying to figure out why all of my unit tests stopped working in a particular class. It turns out that I had accidentally deleted a single character in one of my strings, but the built in diff tool that comes with Team Foundation Server is very simplistic. Learn how [...]]]></description>
			<content:encoded><![CDATA[<p>I recently spent nearly an hour trying to figure out why all of my unit tests stopped working in a particular class. It turns out that I had accidentally deleted a single character in one of my strings, but the built in diff tool that comes with Team Foundation Server is very simplistic. Learn how and why you can replace your stock compare tool with something a little more powerful.</p>
<p>Here is a screenshot of what you&#8217;ll see in the stock Team Foundation Server compare tool:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="74" alt="Default TFS Compare Tool" src="http://www.ytechie.com/post-images/2008/12/image4.png" width="484" border="0"/> </p>
<p>See how hard it is to spot the difference? The problem is, ANY change on the entire line causes it to show up as &#8220;changed&#8221;. That includes whitespace changes. For this reason, I frequently end up with extra full lines that are colored as having been changed, making it harder to see the actual code changes. For the most part, I really don&#8217;t care about whitespace changes because they deal with the formatting of the document, and I&#8217;m more concerned with functional changes to my code.</p>
<p>The good news is that those smart guys at Microsoft make it easy to integrate a third party compare tool right into their tools. James Manning was even kind enough to include <a href="http://blogs.msdn.com/jmanning/articles/535573.aspx" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/blogs.msdn.com/jmanning/articles/535573.aspx?referer=');">detailed instructions and the exact settings needed</a> for every major compare tool. You can even use them for merging if you like.</p>
<p>Since my background is in Subversion and TortoiseSVN specifically, I pulled out my trusty <a href="http://kdiff3.sourceforge.net/" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/kdiff3.sourceforge.net/?referer=');">KDiff3</a> (SourceForge) compare tool. It&#8217;s a common alternative for TortoiseSVN&#8217;s own diff tool.</p>
<p>After wiring up KDiff3, here is what I saw when I compared revisions:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="110" alt="KDiff3 Character Difference" src="http://www.ytechie.com/post-images/2008/12/image5.png" width="484" border="0"/> </p>
<p>Notice how easy it is to see that I changed a single letter (it&#8217;s obviously easier when it&#8217;s full-size).</p>
<p>There are other good reasons to use a third party compare tool (which vary by tool obviously):</p>
<ul>
<li>Easily compare entire file structures (folder diff)</li>
<li>Inline editing</li>
<li>Easy to use outside of Visual Studio &#8211; often with an explorer context menu</li>
</ul>
<p>I recommend giving a few of the compare tools a try and see which works best for you. I don&#8217;t really see any risk in using a third party compare tool, but there are certainly a lot of advantages that you may not even know you&#8217;re missing right now. I suggest also taking a look at <a href="http://winmerge.org/" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/winmerge.org/?referer=');">WinMerge</a> in addition to <a href="http://kdiff3.sourceforge.net/" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/kdiff3.sourceforge.net/?referer=');">KDiff3</a>, since it seems to be fairly popular and feature-rich as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2008/12/advantages-of-a-3rd-party-diffcompare-tool.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ClearType in Remote Desktop with XP</title>
		<link>http://www.ytechie.com/2008/12/cleartype-in-remote-desktop-with-xp.html</link>
		<comments>http://www.ytechie.com/2008/12/cleartype-in-remote-desktop-with-xp.html#comments</comments>
		<pubDate>Tue, 23 Dec 2008 21:39:58 +0000</pubDate>
		<dc:creator>superjason</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2008/12/cleartype-in-remote-desktop-with-xp.html</guid>
		<description><![CDATA[A new feature in XP SP3 that should of particular interest to developers is ClearType over RDP (remote desktop protocol). If you occasionally use remote desktop to work from home, or work remotely to your development machine, please read on.
If you&#8217;re not familiar with ClearType, you can head over to Wikipedia for a full explanation. [...]]]></description>
			<content:encoded><![CDATA[<p>A new feature in XP SP3 that should of particular interest to developers is ClearType over RDP (remote desktop protocol). If you occasionally use remote desktop to work from home, or work remotely to your development machine, please read on.</p>
<p>If you&#8217;re not familiar with ClearType, you can head over to Wikipedia for a <a href="http://en.wikipedia.org/wiki/ClearType" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/ClearType?referer=');">full explanation</a>. In a nutshell, it takes advantage of the fact that each pixel in an LCD screen actually has 3 sub-pixels. They can be &#8220;hacked&#8221; to improve the anti-aliasing of text displayed on the screen. I&#8217;ve been a huge fan of the feature, especially for source code, and I have a hard time living without it. In XP (locally), it&#8217;s turned <strong>off</strong> by default, but turned <strong>on</strong> in Vista.</p>
<p align="center"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="183" alt="ClearType Effects Dialog" src="http://www.ytechie.com/post-images/2008/12/image3.png" width="425" border="0"/> </p>
<p>I had always noticed the remote desktop would not give me ClearType. However, I became curious when I found the following options on my Vista machine. Apparently ClearType over RDP is now supported in the client, and is also supported when using Vista as the RDP server (no hacking needed).</p>
<p align="center"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="326" alt="RDP Experience Options" src="http://www.ytechie.com/post-images/2008/12/image2.png" width="290" border="0"/> </p>
<p>Unfortunately, these options have no effect when using XP. If you want ClearType over RDP with XP SP3 (sorry, only SP3+), add the following registry key:</p>
<p>
<div class="wlWriterSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:fb4c1216-6343-4bb0-a4ea-b87b0ee5266b" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre name="code" class="c">Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations]
"AllowFontAntiAlias"=dword:00000001</pre>
</div>
<p>After you add that registry key, simply reboot the server (XP), and reconnect. From what I can tell, the client options no longer matter. Even if I uncheck the &#8220;Font Smoothing&#8221; option, it still uses ClearType. It&#8217;s not a big deal, but I thought it was worth mentioning.</p>
<p>So far, after using this option for a while, I haven&#8217;t seen a significant performance impact over a VPN on the Internet.</p>
<p>If you want to take this a step further, install <a href="http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&amp;displaylang=en" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3_amp_displaylang=en&amp;referer=');">Consolas</a>, it&#8217;s a font designed specifically for software development, and to take advantage of ClearType. It&#8217;s a free download from Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2008/12/cleartype-in-remote-desktop-with-xp.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>.NET Development Perf Testing in a Cloud VM (EC2)</title>
		<link>http://www.ytechie.com/2008/11/net-development-perf-testing-in-a-cloud-vm-ec2.html</link>
		<comments>http://www.ytechie.com/2008/11/net-development-perf-testing-in-a-cloud-vm-ec2.html#comments</comments>
		<pubDate>Tue, 18 Nov 2008 15:33:19 +0000</pubDate>
		<dc:creator>superjason</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2008/11/net-development-perf-testing-in-a-cloud-vm-ec2.html</guid>
		<description><![CDATA[If you haven&#8217;t heard, Amazon&#8217;s EC2 service provides cloud-hosted virtual machines. Initially, they just supported Linux machine images, but recently have allowed Windows machine images. This means that you can create on-demand hosted virtual machines accessible from anywhere.
 
I decided to do some simple, informal performance testing. To do development performance testing, I like to [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t heard, Amazon&#8217;s EC2 service provides cloud-hosted virtual machines. Initially, they just supported Linux machine images, but recently have allowed Windows machine images. This means that you can create on-demand hosted virtual machines accessible from anywhere.</p>
<p align="center"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="271" alt="image" src="http://www.ytechie.com/post-images/2008/11/image3.png" width="350" border="0"/> </p>
<p>I decided to do some simple, informal performance testing. To do <strong>development</strong> performance testing, I like to run a build process and time it, since compiling is typically the bottleneck on a development machine (other than the IDE and the developer).</p>
<p>I downloaded the source code for <a href="http://www.icsharpcode.net/OpenSource/SD/" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.icsharpcode.net/OpenSource/SD/?referer=');">SharpDevelop</a>, since I knew it would be a fairly large, yet automated build process. The only thing I needed to install was .NET 3.5 SP1. As a baseline, I ran the build on my personal laptop, with these specs: 2.0GHz Core 2 Duo, 3GB RAM, 250GB 5400RPM hard drive. To test the performance of the build, I ran it once, ran a &#8220;clean&#8221; operation, then ran the build a second time, timing it only on the second run.</p>
<ul>
<li>My laptop:&nbsp; 1 minute, 37 seconds  </li>
<li>EC2 Small Instance: 2 minutes  </li>
<li>EC2 Medium Instance: 41 seconds</li>
</ul>
<p>As you can see, the EC2 &#8220;medium&#8221; instance, was over twice as fast as my local machine.</p>
<p>To continue my testing, I installed Visual Studio 2008 Professional, ReSharper, TortoiseSVN, and the Silverlight toolkit. My initial impression was very positive, and I could certainly see myself using it on a regular basis. From a professional standpoint, I would probably prefer a dedicated development machine. However, <strong>for an occasional hobby development environment, this might be a viable alternative</strong>.</p>
<p>EC2 has many advantages over running <a href="http://www.vmware.com" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.vmware.com?referer=');">VMware</a> or <a href="http://en.wikipedia.org/wiki/Microsoft_Virtual_PC" target="_blank" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Microsoft_Virtual_PC?referer=');">Virtual PC</a> on your own computer:</p>
<ul>
<li>Can take snapshots of drives  </li>
<li>Doesn&#8217;t use resources from your computer  </li>
<li>CPU can be upgraded/downgraded as needed  </li>
<li>Theoretically ultra-stable host  </li>
<li>Very fast Internet connection (I downloaded 800mb in less than 30s!)  </li>
<li>Theoretically updated virtual hardware as time goes on </li>
<li>Potentially faster (especially if you use a laptop)</li>
</ul>
<p>However, there are a few obvious disadvantages:</p>
<ul>
<li>Pay-per-hour can get expensive if you use it full-time  </li>
<li>Can&#8217;t drag and drop in and out of the VM like desktop virtualization can  </li>
<li>Need to remote connect using something like remote desktop so graphics performance isn&#8217;t the best  </li>
<li>Only available when you have access to the Internet  </li>
<li>Not necessarily great multi-monitor support  </li>
<li>Virtual machines take a while to start and snapshot</li>
</ul>
<p><strong>Pricing</strong></p>
<p>Right now, Windows based machines are priced starting at $.15/hr (medium for $.30/hr). For a machine that runs 24/7, this can get expensive compared to dedicated hosting. However, for a machine that&#8217;s used for only a couple of hours each day, the pricing is very reasonable.</p>
<p>As an example, if you run a medium instance machine for 8 hours/day, 20 business days/month, you&#8217;ll end up paying $48/month.</p>
<p><strong>Conclusion</strong></p>
<p>Having virtual, dedicated computers available on-demand for pennies per hour is very exciting. <a href="http://www.ytechie.com/2008/11/cloud-computing-and-azure-right-for-your-site.html" target="_blank">This is half of the cloud computing equation</a>, and I believe it&#8217;s going to be an important <em>part</em> of the future of the web.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2008/11/net-development-perf-testing-in-a-cloud-vm-ec2.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
