4 ms·
I love Rob Pikes idea that is dumb to have scope determined by invisible characters
by verdverm 7y ago
I love Rob Pikes idea that is dumb to have scope determined by invisible characters
- 52-6F-62 7y agoI don’t totally mind it. Poor PEP8 implementations can drive me nuts and so can the type of indentation allowed. But otherwise I can get over it. And then there’s Bython... https://github.com/mathialo/bython https://github.com/mathialo/bython
- polotics 7y agoSpace is visible to me.
- siekmanj 7y agoPython doesn’t really have scope in that way. Variables declared inside an if statement can be accessed outside of the if statement.
- somebodythere 7y agoControl-flow blocks aren't scoped in most popular programming languages.
- mlevental 7y agoname one except python
- deleted 7y ago[deleted]
- TheOtherHobbes 7y agoIt makes scope visual and consistent. IMO it's less dumb than having scope defined by pairs of curly braces which are impossible to read without indentation and require extra effort to keep matched - unless you try to automate the matching with a good IDE.
- opn7d7 7y agoErm, white space scoping is impossible without indentation So you end up having the same obligation you call out as a complaint regardless? I used an IDE with visible white space on to help with Pythons requirement?
- erik_seaberg 7y agoThere are a lot of tools that shred whitespace but not curly braces.
- novok 7y agoIn the era that python was created in, autoformatters were not a thing and I appreciated the forced indentation. Nowadays with autoformatters being standard, the downsides of semantic white space is not worth it.