Advantages of a 3rd party diff/compare tool

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.

Here is a screenshot of what you'll see in the stock Team Foundation Server compare tool:

Default TFS Compare Tool

See how hard it is to spot the difference? The problem is, ANY change on the entire line causes it to show up as "changed". 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't care about whitespace changes because they deal with the formatting of the document, and I'm more concerned with functional changes to my code.

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 detailed instructions and the exact settings needed for every major compare tool. You can even use them for merging if you like.

Since my background is in Subversion and TortoiseSVN specifically, I pulled out my trusty KDiff3 (SourceForge) compare tool. It's a common alternative for TortoiseSVN's own diff tool.

After wiring up KDiff3, here is what I saw when I compared revisions:

KDiff3 Character Difference

Notice how easy it is to see that I changed a single letter (it's obviously easier when it's full-size).

There are other good reasons to use a third party compare tool (which vary by tool obviously):

  • Easily compare entire file structures (folder diff)
  • Inline editing
  • Easy to use outside of Visual Studio - often with an explorer context menu

I recommend giving a few of the compare tools a try and see which works best for you. I don'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're missing right now. I suggest also taking a look at WinMerge in addition to KDiff3, since it seems to be fairly popular and feature-rich as well.

Like this post? Please share it!

See a mistake? Edit this post!

ClearType in Remote Desktop with XP

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're not familiar with ClearType, you can head over to Wikipedia for a full explanation. In a nutshell, it takes advantage of the fact that each pixel in an LCD screen actually has 3 sub-pixels. They can be "hacked" to improve the anti-aliasing of text displayed on the screen. I'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's turned off by default, but turned on in Vista.

ClearType Effects Dialog

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).

RDP Experience Options

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:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWinStations]

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 "Font Smoothing" option, it still uses ClearType. It's not a big deal, but I thought it was worth mentioning.

So far, after using this option for a while, I haven't seen a significant performance impact over a VPN on the Internet.

If you want to take this a step further, install Consolas, it's a font designed specifically for software development, and to take advantage of ClearType. It's a free download from Microsoft.

Like this post? Please share it!

See a mistake? Edit this post!

Laptop Hard drive, 5400 or 7200RPM for dev?

My laptop came factory equipped with a 250GB 5400RPM hard drive. Overall, the performance has been pretty good. One of the only areas that has been less than spectacular was virtual machine performance. I placed an order for a 320GB 7200RPM laptop drive. Was it faster? Read on to find out!

Hard Drive

Old drive: Seagate Momentus 5400.4 - 250GB 5400RPM 8MB Cache SATA

New Drive: Hitachi Travelstar 7K320 - 320GB 7200RPM 16MB Cache SATA

Before I upgraded to the bigger, faster drive, I took a few quick benchmarks. It booted in 57 seconds from pressing power to being able to type my password. I was able to build SharpDevelop in 29 seconds, and my XP performance rating was 5.6.

The upgrade process was fairly painless, but I have a fairly good background in computer hardware and imaging (as do many of my readers I'm sure). I created a disk image with Acronis TrueImage (equivalent to Norton Ghost), and wrote that image to the new drive. Since I had about 70 extra gigabytes on the new drive, I allocated that as a second partition. I figured that I would use that extra partition for my virtual machines (typically a good practice).

I was back up and running in less than 2 hours.

Unfortunately, I was fairly disappointed. I was expecting a reasonable boost in performance but was let down. My HD performance rating went from 5.6 to 5.7, but my other benchmarks actually got worse. I'm not convinced that the HD actually made the performance worse, but some part of the upgrade process must have had an ill effect, or my benchmarking process just wasn't very scientific.

Vista Performance Index

Stat summary (obviously unscientific):

SharpDevelop Build29 seconds30 seconds
Cold boot57 seconds74 seconds
Experience Index5.65.7


If I had it all to do over again, I wouldn't buy the faster drive. It just wasn't worth $100 (it's $80 after rebate now). If my drive was slower, older, or smaller, it may have been worth it. Fortunately, the new drive is just as quiet as the old one, and I've noticed no power usage difference. At the very least, it gave me an opportunity to dedicate a partition to my virtual machines.

Like this post? Please share it!

See a mistake? Edit this post!

Jason Young I'm Jason Young, software engineer. This blog contains my opinions, of which my employer - Microsoft - may not share.

@ytechieGitHubLinkedInStack OverflowPersonal VLOG