by usea · 14y ago · 0 comments
Go, on the other hand, checks for many aspects of style at compile-time. If you include an opening brace on the same line, import a package that isn't used, define a variable that isn't needed... all of those will cause compile-time errors.
At first, it can get annoying - especially when you comment out a single line when debugging and then realize you have to make some other minor change elsewhere just to avoid one of the aforementioned style issues.
But on the other hand, I can't deny that it makes my own code cleaner, and it probably saves some errors down the line. Furthermore, it made my code more consistent with existing Go code right from Day 1, even when I was just learning the language. Furthermore, for anybody who wants to do any metaprogramming/code translation, having a more rigid syntax enforced by the compiler is very helpful.
Python doesn't do that. PEP8 is great, and I'm thankful that it's very widely followed. But it's much more powerful when these issues of "style" are made as mandatory as any other aspect of the language specification[1].
This "benevolent dictator" approach has its pluses and minuses, but having written Go code a short while now, I've come to appreciate some of its benefits in the case of coding style.
[1] Okay, so the Go language specification doesn't include all of these, and yes, there are two independent Go compilers. But we can say that it's "mandatory" in the same way that we can say that "Python" has the GIL, when in reality many implementations don't (Jython, Iron Python, etc.)
If you make me manually do paperwork every day, I will quit your thing