No announcement yet.

Improved C++/PHP/C#/Java/Python and other major programming languages matching

  • Filter
  • Time
  • Show
Clear All
new posts

  • Improved C++/PHP/C#/Java/Python and other major programming languages matching

    Matching blocks that are identical is for me the most important feature of any Diff/Merge tool. I know BC3 offers some nice advanced rules to ignore unimportant changes for some pretty specific cases but the core didn't improve so much. I'm talking of course to compare small files, for large files (over 5MB) the algo may be simplified (with a warning to the user).

    How to improve? I found BC frequently take one function content for another. It also almost always misses the closing point of a function. The indentation isn't currently taken into account, nor are the bracket ({}) of C++/C#/Java...

    Sure one of the main issue is handling function blocks that have been moved up and down. There are many ways it could be done but that probably be a BC4 more than a minor important improvement.

    Best is to have an example. I've joined a screenshot of a simple before/after. Note that the closing bracket of "Whatever" is for BC3 matching the closing bracket of "FunctionBar".

  • #2
    Thanks for the example zip.

    Beyond Compare's alignment is something we are always working on and tweaking. We offer various ways for the user to tweak this as well. In this particular example, enabling Never Align Differences aligns the files as you would expect. This, and other, alignment options can be changed under the Session menu -> Session Settings, Alignment tab.

    Beyond Compare 3 considers order important, so even with this option set, FunctionBar will still be detected as a different. You would have to use a custom External Conversion to sort your files before performing the comparison. The External Conversion can be set in the Tools menu -> File Formats dialog, specific format selected, Conversion tab. Under the Grammar tab here, you can also define specific lines to get more weight during a comparison for alignment purposes.

    If you have any specific files you are having trouble aligning, please let us know. You can email them to [email protected] along with a copy of your Support package (Help menu -> Support; Export). Since your support package contains all of your sessions and settings, you will want to email it rather than post it on the public forum.
    Aaron P Scooter Software


    • #3
      I sure understand the power of those special rules and some elements can be tuned a little, now here's the catch: BC3 is for tech people (especially those advanced rules), but tech people compared to office people, work a lot with many different file formats. Developers even more. BC3 is there to save time, there is no time to tune each time one wants to compare 2 files.

      That's why I suggest that you try to improve the comparison algo to be smart without requiring human tuning. Like automatically doing a deeper comparison for small files (there is a slider in BC3). Like improving the deeper comparison to automatically find matching pieces more accurately for those "smaller" files.

      BC3 as a leading in file comparison (and being one of the only non-freeware too) should definitively have the best comparison algo (without hand tuning required for most files). Source codes are probably amont the most frequently used file formats for BC3.