title: Alternatives to GNU diff?
body: <p><code>diff</code> usually produces rather clueless output. Here's a good example. If we start with this:</p>
  
  <pre><code>class World
    def hello
      puts "Hello, world"
    end
    def goodbye
      puts "Goodbye, world"
    end
  end
  </code></pre>
  
  <p>Drop the second method and change the first:</p>
  
  <pre><code>class World
    def hello
      puts "Hello, #{self}"
    end
  end
  </code></pre>
  
  <p><code>diff -u</code> will be a total mess - suggesting two methods have been merged:</p>
  
  <pre><code> class World
     def hello
  -    puts "Hello, world"
  -  end
  -  def goodbye
  -    puts "Goodbye, world"
  +    puts "Hello, #{self}"
     end
   end
  </code></pre>
  
  <p>Instead of much more reasonable:</p>
  
  <pre><code> class World
     def hello
  -    puts "Hello, world"
  +    puts "Hello, #{self}"
     end
  -  def goodbye
  -    puts "Goodbye, world"
  -  end
   end
  </code></pre>
  
  <p>This is just a toy example, so <code>diff</code>'s output is still possible to understand - in practice it usually gets a lot worse.</p>
  
  <p>Are there any alternatives to <code>diff</code> that might be somewhat smarter?</p>