3 ms·
For code review, the top one works for me. In a code review, the code on the right is where the focus is: is that correct? If that change is merged, the right
by kazinator 3y ago
For code review, the top one works for me.
In a code review, the code on the right is where the focus is: is that correct?
If that change is merged, the right side version is what the code will be; the left side becomes a historic artifact indicating what the code was.
I glance on the left to understand what is changing: are some aspects changing that are not intended, and such.
There arise situations when a diff is total garbage, because code has moved around while being changed and whatnot. Sometimes unrelated code is diffed together. In the split diff you can still see the new code how it should be, but it's hard to track the changes.
In git, you can influence the diff algorithm to get a different diff, e.g. "git diff --diff-algorithm=minimal", documented as "spend extra time to make sure the smallest possible diff is produced.". This might be similar to GNU diff's --minimal option.