• Ever wanted an RSS feed of all your favorite gaming news sites? Go check out our new Gaming Headlines feed! Read more about it here.
  • We have made minor adjustments to how the search bar works on ResetEra. You can read about the changes here.

Red

Member
Oct 26, 2017
11,735
I guess I'm in the minority here, but I hate how color happy people get with vscode, including the themes. Colors are there to impart meaning and break up the code into more parsable units, but so many of the themes use like 5 primary colors, and it just defeats the purpose.
Why does this matter to you? Someone else's preference affects you so much that you hate it?
 

trashbandit

Member
Dec 19, 2019
3,910
Why does this matter to you? Someone else's preference affects you so much that you hate it?
Ok hate is a strong work, perhaps baffled is more accurate. But also, the lack of restraint in color usage also makes my preferences hard to accommodate as well since most themes lean color heavy, so yes I'm a bit annoyed by it as well.
 
Last edited:

brainchild

Independent Developer
Verified
Nov 25, 2017
9,482
colorizing brackets is completely superfluous

Of course, yet they're still useful for some people. Similar to UX design, it's not about what's necessary, but what's comfortable and pleasant for the user. If you see no use for rainbow brackets, that's fine, but their popularity has grown for a reason, so I think at this point arguing whether or not it's superfluous is really missing the point, imo
 

Red

Member
Oct 26, 2017
11,735
I disagree that colored brackets are superfluous. I've been using colored brackets for years. I also use colored indents. Makes my life much easier. "Superfluous" suggests they don't provide added value. In reality they've saved me many minutes if not hours of troubleshooting.
 

julian

Member
Oct 27, 2017
16,807
I guess I'm in the minority here, but I hate how color happy people get with vscode, including the themes. Colors are there to impart meaning and break up the code into more parsable units, but so many of the themes use like 5+ primary colors, and it just defeats the purpose. Also worth mentioning, if you align your brackets:
Code:
func()
{

}
colorizing brackets is completely superfluous, since you always know any given bracket is going to be vertically aligned with it's close/open other half.
You literally can't do that in every language and in all cases.
 

trashbandit

Member
Dec 19, 2019
3,910
Of course, yet they're still useful for some people. Similar to UX design, it's not about what's necessary, but what's comfortable and pleasant for the user. If you see no use for rainbow brackets, that's fine, but their popularity has grown for a reason, so I think at this point arguing whether or not it's superfluous is really missing the point, imo
Ordinarily I would agree with this sentiment, but I think the primary driver of rainbow brackets has been because people are having difficulty keeping track of their brackets, rather than an aesthetic preference. A preference is a preference and I can't argue with that, but with regard to code organization, coloring brackets is a band-aid to two issues:
1) Putting the first bracket on the same line as the function definition make keeping track of nesting hard
2) The over-usage of nesting, either implicitly written into a language's design or by the writing style of programmer.

The second issue can't really be solved, but the first absolutely can by adjusting code style to lined up braces. You're sacrificing an extra line for readability, a worthwhile tradeoff imo.
 

trashbandit

Member
Dec 19, 2019
3,910
You literally can't do that in every language and in all cases.
I can't personally think of a language that uses brackets where you couldn't do this. Did you have a language in mind? I'm not including Python in this discussion because brackets usage in Python is a moot point, if that's what you're referring to.
 

Red

Member
Oct 26, 2017
11,735
I can't personally think of a language that uses brackets where you couldn't do this. Did you have a language in mind? I'm not including Python in this discussion because brackets usage in Python is a moot point, if that's what you're referring to.
Brackets can be used for more than designating the start and end of a function body. Ruby for example uses brackets to signify a Hash. When you start specifying nested hashes, things can get hairy without a way to easily match brackets. In JavaScript I've found colored brackets and parentheses to be invaluable when alternating between them. Many times it's less about writing fresh code, it's about telling where things start and end in an inherited project. Especially useful when no linting rules are in place.

This shouldn't really need explaining? There is enthusiasm about colored brackets not because "ooh pretty colors" but because they solve an everyday problem. They are a quality of life improvement.
 

trashbandit

Member
Dec 19, 2019
3,910
A return object in JavaScript.
Do you mean do this:
Code:
function A()
{

  return {
      name: 'aaaa',
  };

}
If so, I would argue that not naming you're return value is worse style, and that
Code:
function a()
{
  var obj = 
{
    name:  "aaaa",
  };
  return obj;
}
is more clear(it also doesn't force you to make a stylistic decision which the other does).
 
Last edited:

Red

Member
Oct 26, 2017
11,735
Doesn't really matter what your preference is, and that's the point. You are poised on nothing but hubris if you believe you are the one who has stumbled upon The Absolutely Right and Correct Way to Do a Thing. If you are privileged enough to deal with only your own code, that's great, congratulations, enjoy your private oasis. The rest of us here in the real world will continue to use tools that improve our lives.

Feels like complaining about a carpenter using a stud finder. If he built the thing himself, sure he probably has a good idea where the thing is. But if he's working on a building new to him, it's valuable to gather insight. These tools exist for a reason. They serve a purpose. They are not superfluous.
 

trashbandit

Member
Dec 19, 2019
3,910
Brackets can be used for more than designating the start and end of a function body. Ruby for example uses brackets to signify a Hash. When you start specifying nested hashes, things can get hairy without a way to easily match brackets. In JavaScript I've found colored brackets and parentheses to be invaluable when alternating between them. Many times it's less about writing fresh code, it's about telling where things start and end in an inherited project. Especially useful when no linting rules are in place.

This shouldn't really need explaining? There is enthusiasm about colored brackets not because "ooh pretty colors" but because they solve an everyday problem. They are a quality of life improvement.
Well you got me there, I've never used Ruby. As you've described it, I can see why you'd want coloration for that, but that's also a pretty specific use case.
 

Stopdoor

Member
Oct 25, 2017
5,781
Toronto
I guess I'm in the minority here, but I hate how color happy people get with vscode, including the themes. Colors are there to impart meaning and break up the code into more parsable units, but so many of the themes use like 5+ primary colors, and it just defeats the purpose. Also worth mentioning, if you align your brackets:
Code:
func()
{

}
colorizing brackets is completely superfluous, since you always know any given bracket is going to be vertically aligned with it's close/open other half.

It probably depends on your language, because this example is way too simple. Reactive JavaScript code gets wild:

Code:
const x = combineLatest([
  objectStream$,
  thingStream$,
]).pipe(
  map(([object, thing]) => {
    return Object.values(object).reduce((array, nextValue) => {
      return array.concat(nextValue);
    }, []),
  }),
).subscribe((array) => {
   doThing(array);
});

I came up with that on the fly lol. This just isn't a problem solvable by indentation alone because this is a minimal example. Maybe it's a JavaScript thing specifically, but being in bracket hell is just inevitable.
 
Last edited:

julian

Member
Oct 27, 2017
16,807
Do you mean do this:
Code:
function A()
{

  return {
      name: 'aaaa',
  };

}
If so, I would argue that not naming you're return value is worse style, and that
Code:
function a()
{
  var obj = {
    name:  "aaaa",
  };
  return obj;
}
is more clear(it also doesn't force you to make a stylistic decision which the other does).
You couldn't even stick to putting brackets on newlines in your own example.
 

trashbandit

Member
Dec 19, 2019
3,910
Doesn't really matter what your preference is, and that's the point. You are poised on nothing but hubris if you believe you are the one who has stumbled upon The Absolutely Right and Correct Way to Do a Thing. If you are privileged enough to deal with only your own code, that's great, congratulations, enjoy your private oasis. The rest of us here in the real world will continue to use tools that improve our lives.
I never claimed I have the absolute right way, only that a common problem can be solved by adjusting code style rather than by plugin usage. You can ignore my gripes about the abundance of color usage, because that is a personal thing and I apologize if if I came off as mean or dismissive with regard to that.
 

Red

Member
Oct 26, 2017
11,735
I never claimed I have the absolute right way, only that a common problem can be solved by adjusting code style rather than by plugin usage. You can ignore my gripes about the abundance of color usage, because that is a personal thing and I apologize if if I came off as mean or dismissive with regard to that.
I don't mean to come across as mean spirited either. It was that word "hate" I got hung up on. Colored brackets are a small thing that offloads mental overhead that can be allocated to other tasks. I've found them very useful. And personally I'm glad people invite color into their IDEs. I don't go crazy over it, myself. But if it makes people happy, it's absolutely worthwhile. No one forces you into it. Different people have different priorities. Some value clarity and minimalism, others enjoy the aesthetic experience of a rainbow IDE. Both are fine.
 

trashbandit

Member
Dec 19, 2019
3,910
It probably depends on your language, because this example is way too simple. Reactive JavaScript code gets wild:

Code:
const x = combineLatest([
  objectStream$,
  thingStream$,
]).pipe(
  map(([object, thing]) => {
    return Object.values(object).reduce((array, nextValue) => {
      return array.concat(nextValue);
    }, []),
  }),
).subscribe((array) => {
   doThing(array);
});

I came up with that on the fly lol. This just isn't a problem solvable by indentation alone because this is a minimal example. Maybe it's a JavaScript thing specifically, but being in bracket hell is just inevitable.
I'd file this example under problem 2) of my previous post, wherein this is the language implicitly pushing you towards a specific style, and in that case the colorization is understandable. Same for the other poster's Ruby example. I've never written JS as gnarly looking as that before.
 
Last edited:

GYODX

Member
Oct 27, 2017
7,253
I never claimed I have the absolute right way, only that a common problem can be solved by adjusting code style rather than by plugin usage. You can ignore my gripes about the abundance of color usage, because that is a personal thing and I apologize if if I came off as mean or dismissive with regard to that.
Or I could simply use colorized brackets. What exactly is the trade-off here?
 

julian

Member
Oct 27, 2017
16,807
Because there's momentum, history, and language design reasons behind the usage of putting the opening bracket on the same line. It doesn't necessarily make it better or more right than aligning the brackets.
I'd argue that if it's more readable to the vast majority of developers who use the language daily, it's better.
 

trashbandit

Member
Dec 19, 2019
3,910
I don't mean to come across as mean spirited either. It was that word "hate" I got hung up on. Colored brackets are a small thing that offloads mental overhead that can be allocated to other tasks. I've found them very useful. And personally I'm glad people invite color into their IDEs. I don't go crazy over it, myself. But if it makes people happy, it's absolutely worthwhile. No one forces you into it. Different people have different priorities. Some value clarity and minimalism, others enjoy the aesthetic experience of a rainbow IDE. Both are fine.
I walked back my usage of the word hate in response to your post. I did not mean it literally, and you were right that it's weird to hate something that in many cases is a preference. But if both ways are fine, then I don't see why it is crazy to voice an opposite opinion to "color brackets are great".

Or I could simply use colorized brackets. What exactly is the trade-off here?
Too many colors can make it difficult to focus. The more colors you have in your code, the harder it becomes to parse their individual meanings.
 

trashbandit

Member
Dec 19, 2019
3,910
I'd argue that if it's more readable to the vast majority of developers who use the language daily, it's better.
Sure, but your sample size isn't really large enough to claim that. Either way, your argument was that you can't align the braces in every scenario, but that's only true if you accept that a stylistic choice is the "correct" way to write, and I think this entire exchange is proof that that is not true.
 

Brick

Member
Oct 25, 2017
978
I know *just* enough about coding to look at the screenshot in the OP on go "Oh, that IS nice."
 

julian

Member
Oct 27, 2017
16,807
Sure, but your sample size isn't really large enough to claim that. Either way, your argument was that you can't align the braces in every scenario, but that's only true if you accept that a stylistic choice is the "correct" way to write, and I think this entire exchange is proof that that is not true.
My sample size? Look up literally any JavaScript style guide which thousands of developers use.

edit: I also want to point out this feature applies to parentheses and braces as well
 

trashbandit

Member
Dec 19, 2019
3,910
My sample size? Look up literally any JavaScript style guide which thousands of developers use.
You remember how I said there's a lot of momentum, history, and implicit language design that informs how people write javascript? Existing style guides are a part of that. Just because a style guide exists doesn't mean it's the preference of the majority of people writing the code. Even if you don't like the style guide, you'll go along with it for the sake of consistency, just as I do when I disagree with a particular style. I'll always advocate for aligned brackets, but I'm not suggesting people mix and match styles. I'm not a monster.
 

julian

Member
Oct 27, 2017
16,807
You remember how I said there's a lot of momentum, history, and implicit language design that informs how people write javascript? Existing style guides are a part of that. Just because a style guide exists doesn't mean it's the preference of the majority of people writing the code. Even if you don't like the style guide, you'll go along with it for the sake of consistency, just as I do when I disagree with a particular style. I'll always advocate for aligned brackets, but I'm not suggesting people mix and match styles. I'm not a monster.
I'm glad you're not a monster but you claimed I was using a small sample size for something anybody who has basic JavaScript experience knows.
 

Mg.

Member
Oct 25, 2017
1,984
Disabled this the moment it hit the Insider build. But surprised it took so long for a feature like this to land in VSCode. It's super useful for some people. Especially with languages that have bracket hell like Javascript.

I have been using this extension for a while. I guess it's time to retire it?
marketplace.visualstudio.com

[Deprecated] Bracket Pair Colorizer 2 - Visual Studio Marketplace

Extension for Visual Studio Code - A customizable extension for colorizing matching brackets
Still using this extension to mark the brackets in the gutter, which for me is a bit more helpful and visually pleasing than coloured brackets (plus the inline highlighted brackets already featured in VSCode).

qFurf1m.png


Unless this is now also a builtin feature I completely overlooked!
 
Oct 27, 2017
3,731
ohhh, even in Python this could be handy.

Just in time for me getting back in programming after a few months hiatus. VScode is a little heavy sometimes, but very useable.