I think the only time the indentation is a problem is when refactoring code - 
copying pasting code blocks seems to be a guessing game with my IDEs and often 
require manual fixes - the issue seems far less common (and more easily 
corrected) when using brackets.  

> On Feb 28, 2021, at 12:12 PM, Bob Alexander <bobja...@gmail.com> wrote:
> 
> 
> I never have understood the *serious* hatred of Python's "indentation as 
> syntax" approach. I've used lots of bracketed and begin/end languages (C/C++, 
> Algol & relatives, Ruby, and most other programming languages), and when I 
> write code in those languages I usually indent as I write. Obviously, 
> indenting makes it much easier for a human to understand the program 
> structure. It never occurred to me to code C, for example, without indenting. 
> Of course, the compiler doesn't mind -- for the computer the brackets are 
> easier to understand, but not for humans.
> 
> When I pseudo-code with pencil and paper or text editor, my natural tendency 
> is to use indentation for structure, not brackets. I'd imagine this is true 
> for almost everyone. When Python came along the Python team adopted the motto 
> "programmable pseudo-code" (or something like that) and, for me, it was true. 
> I personally think Python is very readable. Another minor benefit of the 
> indentation-only approach is the reduced vertical size of a program -- all 
> those trailing brackets on a line of their own add up :)
> 
> So it never occurred to me to object to Python's indentation approach. I 
> always did it anyway. And, even without code formatters, if a program could 
> compile and run, I could rely on the indentation to be representative of the 
> program's actual structure.
> 
> Aside from indentation Python's keyword function arguments and optional 
> arguments often make for more readable code. Go could really benefit from 
> those features, and since they are already available in struct literals, it 
> might not be too hard to fit into the Go language...
> 
>> On Sun, Feb 28, 2021 at 12:35 AM 'Dan Kortschak' via golang-nuts 
>> <golang-nuts@googlegroups.com> wrote:
>> On Sun, 2021-02-28 at 09:23 +0100, Jan Mercl wrote:
>> > I meant, for example, in regexp notation, ` *` vs `\n *` between a
>> > function signature and the opening brace of the function body.
>> 
>> Ah, yes.
>> 
>> > This assumes newline is a whitespace. Most programming languages
>> > agree, but humans may not.
>> 
>> With semicolon insertion, they're not. While they are white, they're
>> qualitatively difference to horizontal white.
>> 
>> Dan
>> 
>> 
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "golang-nuts" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/golang-nuts/uy17JJe8KB4/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/070aa073f9c5c9d78a7d68bf9534fa37d701d384.camel%40kortschak.io.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CAKyHfRMkgqZ0MyQFcyszX3m1DLcrK%3D1Zfiw2ugFx3VsX2QSeAQ%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/52160140-98CA-47AC-AA22-3D7ABB9B2FA9%40ix.netcom.com.

Reply via email to