Historically, Dreamweaver has appealed to both web designers and developers and, with few exceptions, many of the features in Dreamweaver tend to appeal to one camp or the other. Rarely, however, does a feature in the product serve the needs of both classes of user.
The file compare feature in Dreamweaver 8 is one of those rare features that has universal appeal. Whether you are tweaking CSS code for your page layout or updating your ColdFusion component code, file compare will likely become one of your favorite new tools in your web utility belt.
Difference (often referred to as just "diff") or merge utilities are very similar to simple text editors, except there are always two visible edit windows side-by-side. Each text editor typically features line numbering. When a text file is loaded in each of the two text editors, colors and other formatting are used to visually highlight differences between the files.
A couple of rules to consider when performing a file comparison include:
Some examples of when you might want to use the file compare feature include:
In my experience using Dreamweaver 8 so far, integrating file compare into my workflow has helped increase the quality of my code by reminding me to eliminate bloated code or debugging information. It's very easy to forget about snippets of code that you intended to remove at a later date. Fortunately, computers are much better at parsing code and highlighting changes than humans.
The following screen shot is an example of how the file compare utility, FileMerge, helps to visually compare modifications to an HTML file. In this case, the original file is displayed in the right-side text editor view and the updated version on the left side. At the bottom, FileMerge displays that it has detected two blocks of code that are different.
Figure 1. Two different versions of a document being compared in FileMerge
A Google search for "diff" or merge utilities reveals an impressive number of applications ranging from open source options to professional grade (around $100) options. For Windows, there are a variety of free tools available, including WinDiff, WinMerge, and ExamDiff. Though any of these will suffice, I have opted to use WinMerge for this article due to its ease of use and powerful feature set. For the Mac, I recommend the utility FileMerge provided by Apple on its Development Tools website. You can download these using the links in the Requirements section of this article.
In the next sections, I will show you how to install WinMerge for Windows and FileMerge for Mac OS X.