There are few tools reasonable developer can’t really work without. Well, actually maybe he can, but lack of those seriously impacts quality and pace of his work. Dedicated IDE is one of those, but there are some minor ones as well: source version control tool, unit test runner, debugger, profiler and at last but not least - file comparison tool: preferably one capable of 3-way comparison: critical to proper handling of file merging and conflict resolution.
Some go for the easiest (and cheapest) options: WinDiff, WinMerge (http://winmerge.org/) or kdiff3, but I was never stingy on tools I find critical for my work, that’s why I’m using Beyond Compare 3 (http://www.scootersoftware.com/) for quite a long time now. It’s quite cheap, very easy to set-up and does it’s work very well. But it has it’s limitations - if I’m merging severely refactored code files, BC3 easily gets lost when the order of methods or their formatting changes. That’s just because BC3 has no clue about programming languages and logical abstracts used within code files - it just compares bare text without trying to interpret and understand their content.
Some time ago Semantic Merge (http://www.semanticmerge.com/) was announced - the new tool that was (is) supposed to fill the gaps in traditional merge tools due to its ability to understand and analyze the code syntax. Few days ago it has reached 1.0 milestone and that sounded like a great moment to try it out, especially keeping in mind that you can start with short, 1-month long licensing period (very cheap, as it should be).
How does it work then? Does it really do what it promises? In general = yes, but it has some infancy period problems…
- I did some manual tests on cases I’ve prepared (I’ve checked some samples delivered with the installation package as well) and semantic merging for C# indeed works quite well -> SM is able to recognize moved parts of code, even if you’ve refactored their names as well. I’ve seen re-arranging option as well, but I haven’t tried it yet.
- It’s capable of building the hierarchical code map for the merging result - that’s very convenient as you can easily navigate within merged code. Forget about typical kdiff3 problems, when you’ve got conflicts that spanned through several methods, shredding and slicing them into pieces.
- It’s very clean and concise - each quantum of information is presented in an obvious way, you’re not overflowed with information either. The looks are gorgeous.
- Option named “visual diff” is capable of rendering a graphical UML-like (class diagram) map of the code merged within particular file. It aids the merge decisions with visualizing the flow of code parts within and between classes (in a very neat way).
- SM integration with tools doesn’t work out of the box - period. I used the descriptions on SM’s official site, they were corrected in the meantime but they still don’t work. Running diff for Mercurial command-line gets completely lost when I compare whole commits (that contain more than 1 file), running diff in Source Tree (https://www.atlassian.com/software/sourcetree/overview) doesn’t work at all ("The contributors must be specified", what?!). I still can use the tool manually, but it’s far less convenient.
I’ll keep you updated.