Re:Ifs and &&s and Plan 9's Source Code
by LeonidasXIV on Friday May 24, 2013 @06:56PM
(#5765673)
I agree and for this reason, gofmt, an automatic formatter for Go code is possibly my favorite part of the toolchain. It is kinda like PEP8 for Python but formalized into a program (there is a third party pep8 program) or Emacs for Common Lisp. The advantage is that it is a standard tool.
So I can just run it over my code, no matter what editor I used and the code is fine. No arguing what is right, no thinking about where to put some stupid spaces or how to break a fucking line, just run gofmt, done.
Re:Ifs and &&s and Plan 9's Source Code
by adrianmsmith on Saturday May 25, 2013 @06:41AM
(#5766890)
"People can get used to different formats quite easily, but time spent arguing about and maintaining formats can never be recovered" This is nevertheless what this whole discussion is about :-) e.g. should one list those ifs straight like that, or use &&, etc.
"Also, your formatter looks pretty brain-dead", it is, alas, what Eclipse does, and that's pretty standard in the Java world, and it's also pretty standard to use its code formatter alas.
Also, your formatter looks pretty brain-dead. clang-format formats all of those cases (in C++) as in your green examples with Google style turned on. Even the Eclipse formatter should do a better job than what you've posted with the appropriate settings. When I advocate an auto-formatter, it doesn't make sense for you to respond with a blog post talking about a formatter seemingly designed to make everything worse.