3 ms·
I wouldn't be too quick to judge..... quick tell me what these braces close }}}} no idea huh? in VB, closing blocks will tell you what they are closing. So,
by keithnz 4y ago
I wouldn't be too quick to judge..... quick tell me what these braces close }}}} no idea huh? in VB, closing blocks will tell you what they are closing. So, not such a silly idea, just more verbose!
- kazinator 4y ago> tell me what these braces close }}}} The correct answer is: who cares. Those who do care write them like this: } } } The editor lines it up with what it closes. Closing blocks telling you what they are closing were a good idea in the era when programmers had to line up at a job submission window holding decks of punched cards. The reason is that blocks indicating what they are closing can assist the compiler in reliably recovering after syntax errors, continue parsing, so that you get as many useful diagnostics from a single compiler pass as possible. That is almost entirely irrelevant today, though.
- keithnz 4y agoyou may feel they are unnecessary, other people like it, and it definitely isn't from the age of punch cards. I like to watch people code on twitch, and the amount of times I see people get confused about what a particular closing bracket is closing is pretty regular. The other thing it allows is you can jump to all the closing tokens for IF statements in a file really easily. Way easier to write tools to extract certain things out of code files as well. While I don't mind curly brace blocks, I can definitely see the advantages of distinct tokens for different types of blocks