DEV Community

Phillip Anerine
Phillip Anerine

Posted on

Colored Brackets have been a game changer

I've worked in a few different IDEs along my path of programming, usually to the whim of different professors. However, once I started working in VSCode, I've loved it and stuck with it for its lightweight nature and customizability. I'm not sure how I didn't discover it earlier, but my friend suggested I get a color bracket extension, and it has been a game changer.

Unfortunately, I am sometimes mess with spacing when it comes to my code, Going back after a compilation error counting the amount of parentheses gets annoying with a mix of nested brackets, autocomplete brackets, and my fat finger on the shift, 8, and 9 key. Hence, colored brackets!
Image description
All this does is match the color of brackets, parentheses, etc. which makes it much easier at a glance to see what goes where. Another nice feature of it, is if there is an unmatched or extra bracket, it will let you know by coloring it a bright red that screams ERROR.
Image description
Even with this somewhat dense line of code, I'm sure you could spot it out right away. And I sure do whenever I'm coding.

This is the one I use, which I like for its bright colors, but there are other more customizable ones out there if you so please.
https://marketplace.visualstudio.com/items?itemName=2gua.rainbow-brackets

Are there any other extensions or conveniences you use for productivity?

Top comments (6)

Collapse
 
moopet profile image
Ben Sinclair • Edited

There's indent rainbow

screenshot of code with different levels of indentation coloured distinctly

which I quite liked when I used VSCode, but to be honest, too many colours are a distraction for me, and the problem that coloured brackets solve is solved better by changing to a more spaced-out layout.

Edit: I have no idea why that isn't embedding correctly, it's a better image on the page I'm deeplinking it from :/

Collapse
 
peeleebee profile image
Phillip Anerine

Glad to have helped somebody! I'll definitely have to check those out since I plan on learning React soon

Collapse
 
andrewbaisden profile image
Andrew Baisden

This functionality is built into Visual Studio code now.

Collapse
 
jackmellis profile image
Jack

Yes coloured brackets are a huuuge help 🌈
One of the other biggest game changers for me was when I started using VS Code's "refactor" menu (ctrl + shift + r) regularly.

Collapse
 
sswam profile image
Sam Watkins • Edited

I think it would be better to learn operator precedence, avoid adding superfluous parentheses, and keep expressions simple.