Posted by & filed under Tips.

One common task when maintaining software is looking at routines that are close copies of one another. Close… but not quite the same.  You might do this in refactoring or just in looking at a section of a routine that is doing what you want, and is working right, while what you wrote isn’t.

Understand 2.0 adds two new features in to directly address this dilemma:

  • Comparing entities – pick any two entities and textually compare them
  • Comparing arbritray text – paste in any text, compare them

For instance, I notice that I have two functions named “error” in our ZLib example project (Help->Example Project).


I then pull up Change’s entity comparison tool:

2008-05-02 21.23

And then just select C++ functions and choose “error” in both sides:

2008-05-02 21.28

I can then see quite obviously they are the same function, just a bit different.  What I do with that information is up to the situation, but at least now I know the score.

Similarly, I can have a quick diff tool for comparing any arbritrary text.  Just choose “Change->Compare arbritrary text” and paste in the text:

 

2008-05-02 21.37

Hit Okay and see the diff:

2008-05-02 21.38

Next up…. I’ll explain what the 2008-05-02 21.39 does in the Understand 2.0 diff view.