3 ms·
I agree that the Go example code looks ugly, although much of that for me is simply from their ideas on capitalization. Of special note from my perspective is
by KaeseEs 16y ago
I agree that the Go example code looks ugly, although much of that for me is simply from their ideas on capitalization. Of special note from my perspective is that their biggest attempt to clean up syntax, by adopting a JS-esque automatic insertion of most semicolons, has backfired: it doesn't make anything prettier, it's either a wash or a slight loss with respect to obviousness of code, and it introduces a few opportunities for bugs. Perl of all languages did a better job at this goal by just making the terminator of the last element of a block or list optional.
I appreciate their maintenance of an end delimiter to blocks that is vertically aligned with the start of the block, although they could have gotten a bigger win imo by going with the ALGOL/Ruby style 'end' rather than the C style curly brace (and in doing so freed up curly braces to unambiguously be used for something else).
- koenigdavidmj 16y agoYeah, that was likely a big mistake on their part. Arguments on significant whitespace aside, I think that this is one thing that Python got right. (For reference, Python's rules are that ending a line with a backslash will continue a statement, and the same effect will occur automatically if you have a parenthesis, curly, or bracket open.) I might also be convinced that it would be a good idea to have statement continuation happen if the last token on a line was a binary operator, for the benefit of code like: if self.foo() and self.bar() and self.baz(): do stuff (Currently PEP 8 requests that you put parentheses around the test.)