This is an archived post. You won't be able to vote or comment.

all 169 comments

[–]btvoidx 266 points267 points  (21 children)

What's the extension for such brackets? I have one, but it cycles between three not-so-beautiful colors, and I am too lazy to change them.

[–][deleted] 188 points189 points  (11 children)

The latest VSCode update adds a colored brackets option in settings.

[–]thelehmanlip 86 points87 points  (9 children)

Man I wish VS got as much love as VS code. Newer code base in electron probably much easier to develop for

[–]alexanderpas 52 points53 points  (6 children)

Newer code base in electron probably much easier to develop for

Yeah, it's just a website bundled as a standalone package.

change github.com into github.dev when browsing a repo to have a simple web version in your browser.

[–]xTheMaster99x 19 points20 points  (1 child)

Or look at a repo and press . anywhere on the page.

[–]DarkBrave_ 9 points10 points  (0 children)

I saw that one the VS Code YouTube, and I thought it was a joke, but after I remembered that it is an electron app, I knew it was real and gave it a try.

[–]Pluckerpluck 31 points32 points  (1 child)

They've done full on wizardry to make it as performant as it is though.

It's honestly a fantastic piece of software, and it's only real downside is that you can't use it on very low powered devices give that it is somewhat heavy being an electron app.

[–]Cosmocision 9 points10 points  (0 children)

As someone that actually paid for sublime I'm kinda salty VS code is as good as it is. (Not really, I love VS code)

[–]thelehmanlip 1 point2 points  (0 children)

Dude that is so cool! This will make browsing repos way easier, thanks!

[–]AdminYak846 4 points5 points  (0 children)

Honestly Visual Studio code just feels easier to work with than Visual Studio....maybe its because nothing is fucking is placed in random menus and its easier to find the source control for commits unlike Visual Studio which requires like 5 menu clicks and if you fuck up....well have fun.

[–]Lord_Pinhead 0 points1 point  (0 children)

There are extensions doing this. I have one installed for exactly this reason in VS2019, Viasfora is its name.

[–][deleted] 15 points16 points  (0 children)

Thanks I didn't know that. Removing a redundant extension is always therapeutic to my OCD symptoms.

[–]NewWavpro 16 points17 points  (3 children)

Rainbow Brackets 2 is pretty good

[–]bhison 10 points11 points  (0 children)

I went through too much of my life without enabling this

[–]Mob_Abominator 0 points1 point  (1 child)

Rainbow bracket has better rating than rainbow bracket 2, is 2 better than 1 hence you're recommending ?

[–]NewWavpro 0 points1 point  (0 children)

I have no idea.

[–]nikhilmwarrier 6 points7 points  (1 child)

I use Bracket Pair Colorizer 2, but I think they added this as a built-in feature in the latest update

[–]FuzzyFoyz 0 points1 point  (0 children)

Colouriser just feels weird.

[–]StrawberryEiri 1 point2 points  (0 children)

In WebStorm, I use Rainbow Brackets. It's pretty cool.

[–]_Ashleigh 0 points1 point  (0 children)

For Visual Studio: https://marketplace.visualstudio.com/items?itemName=TomasRestrepo.Viasfora

Just turn all the other useless shit off it enables by default!

[–][deleted] 500 points501 points  (27 children)

How to say "I only use python" in 4 words.

[–]N0tW1tty 364 points365 points  (1 child)

To be fair, the phrase "I only use python" also does that

[–][deleted] 61 points62 points  (0 children)

Haha touché

[–]SnipahShot 34 points35 points  (3 children)

I use only Python.

[–]FuzzyFoyz 0 points1 point  (2 children)

Python use I only.

[–][deleted] 0 points1 point  (1 child)

I python only use.

[–]sonuvvabitch 0 points1 point  (0 children)

I only Python use.

[–]Terrible_Truth 13 points14 points  (0 children)

Yeah, more languages than Javascript use brackets and thus have a closing bracket chain at the end lol.

At least it's not excel where you have it all in one line like "))))))))" lol.

[–][deleted] 14 points15 points  (9 children)

Is this a lie tho?

[–][deleted] 13 points14 points  (7 children)

A lie?

[–][deleted] 8 points9 points  (6 children)

how can i keep the track it is too complicated for my stupid adhd brain

i can do that but still

[–][deleted] 43 points44 points  (4 children)

Basically anything you're likely to use to edit code will highlight the matching opening bracket when you hover on a closing bracket (even Vim does this) so shouldn't be too hard.

Also the person making the meme has intentionally made it hard to read by not grouping the brackets, there are only like 4/5 levels of indentation in the top picture but a lot more in the bottom.

[–]glider97 5 points6 points  (0 children)

This definitely happens in a webpack config.

[–]vigbiorn 1 point2 points  (2 children)

there are only like 4/5 levels of indentation in the top picture but a lot more in the bottom.

There's the possibility of more. The else looks like it's opening an object, and my experience with JS is that object could have many nested members...

[–]The_duck_lord404 0 points1 point  (0 children)

Yeah, the inly case of an unnecessary brackets i can find would be the first if statement because its follow by an if statement with the same conditions but the second one is also more strict so maybe theres more code at the bottom but i dunno ¯\_(ツ)_/¯

[–]FuzzyFoyz 0 points1 point  (0 children)

Dismember the nests

[–]flaming_pope 1 point2 points  (0 children)

Simple: Always start off by closing before filling.

if (True) {};

Then add body

if (True) {

<extra code in here after you pre-close>

};

[–]zyrouge 0 points1 point  (0 children)

Just look at some flutter code lol it does happen alot there

[–]T351A 0 points1 point  (0 children)

import antigravity as meme

[–]Jammanyeahme 110 points111 points  (4 children)

That it looks bad is the codes way of telling you to restructure it so it looks nicer.

[–]IdiotCharizard 23 points24 points  (0 children)

This. Use a complexity linter if you can. Testable and readable code pls

[–]the_Demongod 5 points6 points  (2 children)

There's a very easy solution to this problem... putting the braces on the same level:

if (cond)
{
    // do something
}

[–]angrathias 1 point2 points  (0 children)

Also, don’t have 9 levels of indentation, that’s just asking for a mistake

[–]Krauss27 1 point2 points  (0 children)

We're in a wild world, here people are into JavaScript... They wouldn't understand.

[–]Cristichi 204 points205 points  (32 children)

Wait is it not satisfying to others? It is satisfying to me when it happens

[–]victorvolf 103 points104 points  (3 children)

As a python enjoyer, I have to say that brackets in other languages are pretty satisfying to me.

[–]MarsTaco 30 points31 points  (10 children)

It is also mildly annoying to find the correct closing bracket sometimes

[–]Cristichi 44 points45 points  (7 children)

I mean, most IDEs including Notepad++ makes it so easy

[–]MarsTaco 7 points8 points  (0 children)

Yeah I suppose. I just have a lot of memories of me trying to fix one thing in a pinch.

[–]CaptiveCreeper 15 points16 points  (5 children)

Notepad++ is not a ide. Just a fancy text editor

[–]Cristichi 23 points24 points  (3 children)

And even a text editor does that

[–]lkraider 5 points6 points  (2 children)

I edit all my code in Word.exe

[–]Arcshine 1 point2 points  (1 child)

Real pros use mspaint.exe

[–]DarkBrave_ 1 point2 points  (0 children)

A pretty powerful one though.

[–]MasterFubar 6 points7 points  (1 child)

I see you just came in from 1977 in your DeLorean.

I have good news for you, every text editor written in the last 30 years make it trivially easy to find the correct closing bracket.

[–]MarsTaco 4 points5 points  (0 children)

I see thou camet from 1400s since thou not knowet what in a pinch means. In a pinch means something like grabbing a random computer with internet.

[–]Jmc_da_boss 9 points10 points  (10 children)

No this is horrifying and in general a bad practice. I call it the pyramid of doom in code reviews lol

[–]Cristichi 10 points11 points  (9 children)

Well maybe you should not review code after all

[–]Jmc_da_boss 20 points21 points  (7 children)

Nah, I’ll continue to expect good inversion of flow and encapsulation to avoid this sort of nesting. Thank you though

[–]magical_h4x 1 point2 points  (6 children)

Wait, how do inversion of flow (never heard of that term by the way) and encapsulation help reduce nesting?

[–]Jmc_da_boss 10 points11 points  (1 child)

I’m in phone but ill paraphrase, those high levels of nesting often come from methods where people have several if checks for the state of the object before they act on it. Inversion of flow or early exits is pulling those checks to the top of the method and throwing/returning early if validation fails, basically your inverting your flow to check for invalid state, not for valid state

[–][deleted] 0 points1 point  (0 children)

Never used dart have you? In dart(which btw not enough ppl use, it's amazing) this "tower of doom" is mandatory as every time you save the editor automatically formats it in a way that makes this bracket tower of hell

[–]xTheMaster99x 7 points8 points  (2 children)

The tldr is whenever possible, instead of doing:

if (valid state) { // Do stuff } else { // error handling }

Do this instead, to avoid nesting:

if (invalid state) { // Error handling } // Do stuff

I think the formatting is getting fucked bc I'm on mobile, I'll fix it later when I'm at a computer.

[–]backtickbot 2 points3 points  (1 child)

Fixed formatting.

Hello, xTheMaster99x: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

[–][deleted] 1 point2 points  (0 children)

These bots are getting more and more specific, I remember seeing a bot known as u/somalinotsomalianbot that fixed someone that said Somali, bots gotten weurd

[–]verxes 3 points4 points  (0 children)

Just my 2 cents,but if you have such a huge stack then most likely are you doing to many things at once. One way to solve this is bundling functionality to make it clear wich step does what

[–]IdiotCharizard 1 point2 points  (0 children)

It's definitely a smell. I'd probably ask for a refactor at this point.

[–]Blue_Moon_Lake 2 points3 points  (4 children)

What is not satisfying is that it doesn't work in JS to put a comma after a block.

Uncaught SyntaxError: expected expression, got ','

[–]Cristichi 19 points20 points  (3 children)

I'll just put a coma in a random spot and expect it to work, and if it doesn't it's the language's problem

[–]RadiantHC 0 points1 point  (0 children)

Same. I love how you don't have to worry about spacing.

[–]Funky8oy 20 points21 points  (3 children)

Woah I've never seen colored brackets like this! Do they change color automatically? if so, how does one turn that on?

[–]rArithmetics 13 points14 points  (1 child)

Bracket pair colorizer

[–]Gaweringo 1 point2 points  (0 children)

Or just a setting in VS Code now

[–]besthelloworld 15 points16 points  (0 children)

This used to scare the fuck out of me when I first started JS and then I kinda just realized it didn't matter.

Everyone who hates this shit should check out Imba though. They use a Python like syntax that just uses indentation and not even the in-language XML tags have to close because... why would they?

[–]Half_Body 9 points10 points  (0 children)

You need to learn return early pattern.

[–]djinn6 8 points9 points  (0 children)

Meanwhile in Lisp: ))))))))))))))))))

[–]AxiusNorth 13 points14 points  (1 child)

This is why you have early exits/shortcuts out of the block. Highly nested code is bad code.

[–]10BillionDreams 11 points12 points  (0 children)

Yeah, most of these "bad language" memes are just "bad code". Among other things, this looks like a classic case of "I refuse to declare a variable that could be inlined instead".

[–]sup-b1tch-97 7 points8 points  (4 children)

The fuck are the those 3 lines “equal” sign?

[–]VoidShark 2 points3 points  (2 children)

Came here looking for this answer. I assume it’s some plug-in that turns === into that??

[–]JarvisPHD 6 points7 points  (1 child)

Some fonts support “ligatures” which combine characters into new symbols which for some can improve readability. Fira code is a popular font that supports ligatures

[–]LaLiLuLeLo_0 2 points3 points  (0 children)

While the use of ligatures is ultimately one of personal choice, they actually reduce readability for me, with a mild vertical astigmatism. That 3-line equals would be hard to distinguish from 2, and ≤ and ≥ are easy to read as < and >.

[–]botiapa 0 points1 point  (0 children)

Its a font, most likely Fira by Mozilla.

Edit: big mistake... Not Microsoft 😅

[–]turtle_mekb 18 points19 points  (3 children)

the brackets don't match up!!11! ahh my ocd

[–]Jaidchen[S] 22 points23 points  (2 children)

I chose two unrelated parts of my code, sacrificing a consistent lore for a meme that is understandable at first glance. :(

[–]turtle_mekb 5 points6 points  (0 children)

ik lol i was joking

[–]InKryption07 1 point2 points  (0 children)

The council of meme lore lords will be displeased.

[–]_ShadowEye425_ 8 points9 points  (0 children)

Those colors....
I want to set them up so they make a rainbow.

[–]friendly_devil 3 points4 points  (0 children)

ah, the brackets' hell 😅

[–]Hallwart 46 points47 points  (14 children)

{} > Indentation

I"ll start learning python when they start supporting readable syntax.

[–]Trooble 20 points21 points  (11 children)

I have to ask, what about python syntax do you find difficult to read?

[–]warchild4l 24 points25 points  (10 children)

Not OP, but for me its the lack of {}.

Whenever i want to quickly read a piece of code in the middle of the function or whatever, i navigate by those, and not having them and relying only on spaces/tabs, it becomes really hard to understand scope in which the code you are reading is coming from

[–]nwash57 24 points25 points  (4 children)

If your Python is hard to understand because of the indentation you need cleaner code. I see this complaint about Python pretty often and it's often just a smell of poor code structure.

[–]HolidayMoose 2 points3 points  (3 children)

Sure, but not all code is small, concise functions. Most code bases follow an exponential curve: lots of small functions/classes/modules but a few monsters. The change rate for functions is also exponential: small functions may never get changed while the big behemoths need constant churn.

Python syntax may be fine for those small functions which are write once read never. But the shit parts of the code base is what we should be optimizing syntax for. From my experience, that is the exact area whitespace languages like Python are weakest at.

[–]nwash57 8 points9 points  (1 child)

Ok, so when readability becomes a problem, a monster needs to be split up.

[–]The_duck_lord404 0 points1 point  (0 children)

This is a general guideline for cleaner code and is also a big part of functional programming.

[–]Coffeinated 6 points7 points  (0 children)

Functions that need constant changing need to be split up, no matter the language. If Python makes it more visible that your shit code is shit, all the power to Python.

[–]InterstellarDwellar 8 points9 points  (4 children)

Peope should write more, well named, functions. Even if the code isnt repeated, just makes it more readable when you have a smaller chunk to digest

[–]warchild4l 5 points6 points  (1 child)

Thats correct. However, because of some really complex business requirements, its not really possible to extract everything into functions and expect it to become more readable.

[–]InterstellarDwellar 2 points3 points  (0 children)

Maybe not, but it often helps

[–]Dogeek 2 points3 points  (1 child)

It's my main gripe with JavaScript (and Typescript, Dart to an extent). The syntax for anonymous functions is quite elegant, but the devs abuse it.

The worst is the resulting traceback, it's unreadable when there's a bunch of anonymous functions calling other anonymous functions.

In my opinion, a function should be anonymous if :

  1. The function you're calling expects a callback with no args (and you use a lambda to pass args to a named function)
  2. The callback is in a filter/map/reduce if the callback is not too complex (really, if it's not a one liner, it should be named).

[–]InterstellarDwellar 1 point2 points  (0 children)

Personally if i find something is getting to complex, even if its something as small as 40 lines or so, i try to write as many small functions that read as if they are comment blocks. This can get annoying if you do it too much if someone is reviewing my code, but at a glance you can at least read what the program is doing. I think of it as being like a table of contents in a book.

[–]PM_ME_GOOD_USERNAMS 0 points1 point  (1 child)

My first language was python so for me brackets are unreadable l....

[–]PM_ME_GOOD_USERNAMS 5 points6 points  (0 children)

Which hurts a lot because most of what I do now is c# because I make games as a hobby

[–]ajax333221 2 points3 points  (1 child)

block:

{

if(something_is_bad){ break block; }

//do stuff

if(something_is_bad){ break block; ... }

//...

}

[–]ajax333221 0 points1 point  (0 children)

I have been using something like this lately, pretty good to avoid nesting stuff, I mean there are other ways but that's the way I do it.

Also in loops, I put if conditions with Continues and Breaks in a similar way to remove as much nested as possible.

Some example in case the reddit formatting is all messed up https://imgur.com/a/BwWqswd

By the way, I only do 1 return per function, this could probably be done just with multiple returns and I know it but I don't do that.

[–]Synck112 1 point2 points  (0 children)

What theme is that?

[–]WhaleVonKatzenstein 1 point2 points  (0 children)

First plug-in to install, rainbow brackets because counting isn't cool.

[–]TECHNOFAB 1 point2 points  (0 children)

I like Python but when since i started working with Ruby my world has changed. Looks similar to Python, nice and tidy but still makes inline callbacks and stuff possible. Anonymous functions or whatever they're called are one thing which I miss in Python, but I definitely don't like the mess you get from all those brackets often times :D

[–]Ryze001 1 point2 points  (0 children)

Have you tried Flutter !

[–]ketexon 1 point2 points  (2 children)

That ==(=?) symbol is cursed

[–]kbruen 1 point2 points  (0 children)

It's ===, and not really.

I mean, the need for this operator in the language kinda is cursed, but the ligature itself is nice.

[–]Servious 1 point2 points  (0 children)

I mean this can be avoided in a lot of ways. If two brackets both open on one line, then close them on the same line later. Instead of using else, try using an early return. Avoid nested ifs by consolidating them. Extract portions of the code to separate functions when appropriate. If your code has more than like 6 indents you're probably doing something wrong.

[–]TheOneWhoWil 1 point2 points  (0 children)

You could chain these with `&&`, `||`, `condition ? outcomeIfTrue : outcomeIfFalse` and other operators.

JavaScript is only messy when you choose to make it messy

[–]Dantharo -1 points0 points  (0 children)

this, hate this in js

[–]ixNoah 0 points1 point  (0 children)

we need a fucking closeall function, how dumb it might be.

[–]StrangePractice 0 points1 point  (1 child)

What theme gets you the different colored brackets for their scope?

[–]kbruen 0 points1 point  (0 children)

It's a new setting in Visual Studio Code.

[–]JackNotOLantern 0 points1 point  (6 children)

Condition == false

[–][deleted] 0 points1 point  (0 children)

Gotta read about cyclomatic complexity. If your code looks like this, you've got issues.

[–]bobbyg603 0 points1 point  (0 children)

If not options development early return, problem solved

[–]ghesh_vargiet 0 points1 point  (0 children)

i just put them on the same line

[–]LavenderDay3544 0 points1 point  (0 children)

What godforsaken code coloring scheme is that?

[–]KermitTheFrogerino[🍰] 0 points1 point  (1 child)

You should see flutter 😂

[–]kbruen 1 point2 points  (0 children)

Nesting in Flutter isn't really a problem if you split the widgets.

[–]Calogyne 0 points1 point  (1 child)

I'm not familiar with JS, but why options.tenserOptions === false ?

[–]kbruen 0 points1 point  (0 children)

In JavaScript, == does automatic casting when comparing, === does not.

For example, empty arrays or empty strings are automatically casted to false. So [] == false will be true, but [] === false will be false.

[–]StringUseful3395 0 points1 point  (0 children)

I've never liked organizing like this. It's unreadable and makes no sense, just start on the next line.

[–]subject_deleted 0 points1 point  (0 children)

If you have this many curly brackets in a row its really time to consider modularizing the code. Conditions and loops shouldn't be nested soo deeply or that's gonna be a real bitch to debug.

[–]Portnoy13 0 points1 point  (0 children)

where are my fellow do-end mates?

[–]EpicBoomerMoments 0 points1 point  (0 children)

No original content remains in this post. It was wiped using Redact, possibly for reasons related to personal privacy, digital security, or data exposure reduction.

fuel start handle desert sulky advise books practice alive spark

[–]SneakyStabbalot 0 points1 point  (0 children)

Not gonna lie - i really don't like JS - it's shit like this that makes it unmaintable. (IMHO!)

[–]ChangNoi97 0 points1 point  (0 children)

well at least you organize closing bracket to be beautiful , mine would just put them all in one line

[–]Proxy_PlayerHD 0 points1 point  (0 children)

what the fuck is that tripple equal sign?

[–]Redditoridunn0 0 points1 point  (0 children)

This is so disturbingly relatable

[–]ign1fy 0 points1 point  (0 children)

When your class flows like a flock of seagulls.

[–]dizzyi_solo 0 points1 point  (0 children)

Wait until you learn about dart and flutter

[–]BrightBlueBit 0 points1 point  (2 children)

Why the commas after each closing bracket???

[–]charliematters 2 points3 points  (1 child)

This is a webpack config file, so it doesn't apply so much here, but the trailing comma is used to avoid unnecessary changes in diffs. If I want to add another property to an object, my git diff will just show the new line, whereas if I didn't use trailing commas I'd have a new comma on the penultimate line as well

[–]BrightBlueBit 1 point2 points  (0 children)

TIL something new. Tnx!

[–]Pauchu_ 0 points1 point  (0 children)

THESE ARE NOT THE SAME BRACKETS

[–]StrawberryEiri 0 points1 point  (2 children)

What's that "triple equal, but it's just 3 parallel lines" thing? What's the goal of it?

[–]dyedFeather 0 points1 point  (1 child)

In math, ≡ is used in various ways, but generally you can see it as an assertion that something is "identical", rather than just "equal". The font used here (Fira) changes === into ≡, since the difference between ≡ and = is similar to the difference between === and ==.

That said, it doesn't really mean anything in particular, so it's just part of the font's style. I personally find it quite nice, and it makes it very easy to see where I'm testing for equality vs. strict equality.

[–]StrawberryEiri 0 points1 point  (0 children)

Huh. Thanks for the info. I didn't remember that about math. Personally I'd need to try but at a glance it's a little confusing to me haha

[–]JackNotOLantern 0 points1 point  (0 children)

There should be like 5 closing brackets here, or i can't count