C# principal product manager Mads Kristensen has developed an extension for Visual Studio called Rainbow Braces that displays opening and closing curly brackets, parentheses and square brackets in matching colours in order to make it easier to identify the scope of a particular pair.
“Rainbow Braces makes it easier to make sense of nested code,” said Kristensen on Twitter, noting that the extension is a response to this feature request.
Bracket Pair Colorization, the same feature, was built into Visual Studio Code in version 1.60 a year ago. “I regularly use both VS Code and VS 2019/2022 and I would love to have this feature available in Visual Studio,” said the request.
The extension, however, has appeared under Kristensen’s name, not as an official Microsoft add-on. In the case of VS Code, converting the feature from an extension to a core part of the editor produced a claimed 10,000 times performance improvement.
There is already an extension called Viasfora that has this feature, among many others. Viasfora was inspired by a longstanding Vim plugin called Rainbow Parentheses, according to Viasfora creator Tomas Restrepo. Why then do Rainbow Braces? “Numerous people over the years have expressed a desire for a smaller extension that does nothing but rainbow bracing,” said Kristensen.
Microsoft is in the fortunate position of owning the two most popular IDEs, Visual Studio and VS Code. Officially Visual Studio, which runs on Windows and also has a Mac version, is a “comprehensive IDE”, while VS Code is “a standalone source code editor” that runs on Windows, Mac and Linux. In practice though, VS Code with the right extensions supports coding, compiling, unit testing, debugging, integration with source code repositories, and many advanced features that make it more like an IDE than just an editor.
Although Visual Studio retains some unique advantages for Windows development, it is now not uncommon for the “comprehensive IDE” to play catch-up with features that are already in VS Code. Another advantage of the open source editor is that it is pretty much the same on all platforms, whereas Visual Studio is very different on a Mac and does not run at all on Linux.