Project Iffy

June 29, 2008

And the USP is…

Filed under: 30days — Tags: , — rngbus @ 11:19 am

Grammar aware diff.  Instead of doing a line by line diff and maybe adding some smarts to ignore whitespace and comments, Diffy will perform a diff on the syntax tree of an arbitrary language.

There are a few advantages to this approach, the largest of which is that Diffy will be able to intelligently describe what has changed in a file.  Effectively, what a diff tool tells you is:

  • added lines 122-126
  • removed lines 24-28
  • changed lines 207-234

Which is not very useful without knowing what those lines contain.  What diffy will tell you is:

  • added class Brush
  • removed comment
  • changed method Draw in class Canvas

Which seems a lot more user friendly to me, especially when you’re trying to refresh your memory to write a check in comment or showing your changes to someone during a code review.  Here’s a shot of it in action:

The functionality is very basic right now, but I plan to add support for detecting move and copy operations in addition to the standard diff add/remove/change.

So, there you have it.  Do I have a product?  Please cast your vote and give me your thoughts in the blog comments.

8 Comments »

  1. Great USP! Being able to navigate the diff using the language-centric view would make it easy to get a feel for where the changes are, and what they have in common. Especially useful for code reviews or similar, where it’s not your own code you’re editing. Also good for quickly spotting changes that shouldn’t be there.

    This language-awareness could make your diff algorithm better at spotting and aligning related pieces of code the same way a human would. So for instance, knowing that a C function starts and ends with a brace would help it line up differences sensibly.

    Having said that, you’re going to have to do a lot to compete with established diff tools. Until I can copy edits from one side to the other, edit the files arbitrarily in place, copy and paste code around, navigate efficiently with the keyboard, customise the thing to within an inch of its life, diff entire directories trees and who knows what else I can’t think of off the top of my head, you won’t be tearing me away from Beyond Compare, Meld, or whatever else I’m currently using…

    Comment by richiehindle — June 29, 2008 @ 1:07 pm

  2. Great idea – I’ve seen it somewhere else recently but can’t remember where. Seems like it’s less of a general-purpose diff tool and more of a “what have I changed” memory aid for filling in check-in messages. Perhaps there’s an opportunity for creating a simple UI just for the check-in message scenario (i.e., context menu on a folder in explorer => Create diff note and a high-level textual diff is copied to the clipboard. Perhaps the actual visual diff could be hidden. Just an idea. Oh, and please make it recursive. Single-file diff tools are almost useless.

    Of course, language support will be critical. I guess C# and Java will be the big sellers (and probably much easier than Python/Ruby).

    Hmm… just found that tool. It’s RubyDiff… for Ruby obviously: http://endofline.wordpress.com/2008/06/04/introducing-rubydiff/

    Comment by Jamie Lawrence — June 29, 2008 @ 2:01 pm

  3. My two cents.

    Crowded market.

    Great USP.

    But your diff must be atleast as good as Beyond Compare in terms of speed and ease of use for the obvious cases.

    Make it cross platform (and cost around the same as BC2) and you have a customer.

    I never used BC2 past the trial because a lot of my work was on Linux (I see now they have BC3 on Linux.)

    Anyway, best of luck.

    Comment by Sohail — June 29, 2008 @ 8:58 pm

  4. Sounds like a good idea. The diff tool in IntelliJ IDEA does something similar but it is not stand-alone.

    I really see value in your tool. Especially if it is easy to plug in different language syntaxes.

    Comment by Steve McLeod — June 30, 2008 @ 1:50 am

  5. The idea is good and possibly useful as a code maintenance tool, but I think you are chewing off more than you can handle for a 30 day challenge. The parsing and semantics could be challenging.

    Comment by Grok2 — June 30, 2008 @ 2:34 pm

  6. Hmmm. Nice idea, actually I’m writing something similar but for one specific file type. I’d better get working!

    Comment by Matt — July 1, 2008 @ 7:25 am

  7. […] for almost everybody. Steve Cholerton (SMSRelay) added screenshots, and so has Philip (misvCRM) and Project Iffy. Others have checked in with status updates such as Rafael,  Susan,and the Runimal […]

    Pingback by June is over (1 days to go) | Mike on Software — July 2, 2008 @ 7:24 am

  8. I’ve just changed this:

    copyFiles = [‘*.gif’, ‘*.jpeg’, ‘*.jpg’, ‘*.css’, ‘robots.txt’]

    to this:

    copyFiles = [‘*.gif’, ‘*.jpeg’, ‘*.jpg’, ‘*.png’, ‘*.css’, ‘robots.txt’]

    and my existing diff tool has highlighted this as the difference:

    png’, ‘*.

    Duh, stupid. Now I’m not sure that’s enough to make me look for another diff tool 😎 but it’s a good (if small!) example of why syntax-awareness would be a good addition to an otherwise-great diff tool.

    Comment by Richie Hindle — July 4, 2008 @ 1:16 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.