Lately I got questions asking for a quick lightweight tool to compare code files. Even though there are several tools like Beyond Compare, Araxis Merge, etc… which have lot of comparison and merging features, I use Visual Studio Code for quick file comparison during development or otherwise. For me, VS Code comes in handy as it is cross platform and I am using it on both macOS and Windows. I am using it for minor project development and even as a simple text editor. So naturally VS code is my go-to tool for file comparison. Here are the simple steps to compare the contents of two code files in VS Code.
Steps to compare contents of two files
- Open both the files in VS Code.
- From the left Explorer panel, right-click the first file and choose Select for Compare from the right-click menu.
- Then right-click the second file and choose Compare with Selected.
- Both the files will be opened in the main panel, side by side in inline view mode which is comfortable for comparing the differences.
- More about Visual Studio Code here.