parsd
Joined 8 years ago
Joined 8 years ago
For example, it’s the compiler and not gofmt that dictates that you must write a curly brace only on the same line of an “if” statement. If you put it on the next line, you don’t have unformatted code - you have a syntax error.
However, the compiler doesn’t care if you have too much whitespace between tokens or if you write your slice like []int{1, 2,3,4}, but gofmt does.
We could say the rules of the compiler and gofmt don’t even overlap.
A myth? Do you not know why there are monuments to victims of communism all over Europe? Have you not heard of the holocaust that the Bolsheviks unleashed on Russians, Ukrainians and countless other ethnic groups? Do you not know how many millions of people were murdered in communist China during its Cultural Revolution? Do you not know why communism is often rightly compared with Nazism?
I often prefer not to enable syntax highlighting just for color. Occasionally I'd choose some minimal theme that only highlights string literals and keywords. So it has two or three colors. But some of the color schemes I see are a festival of lights where every special element of syntax has its own color. I don't understand how that is supposed to help me parse anything and why the rules are complex. The `range` keyword needs to be purple, and `chan` must be navy blue. Why exactly? And every site has a different color scheme? There is no consensus, and there shouldn't be.
For a serious community-driven project like Go, dealing with the question of syntax highlighting is strange. The creators deliberately avoided the questions of IDEs and editors for Go, leaving them to the community. I think the same principle applies here.