3 ms·
Honestly, no. I get the premise, but at least with braces there's no ambiguity at all about where a statement begins and ends. It's certainly not going to be t
by krapp 12y ago
Honestly, no.
I get the premise, but at least with braces there's no ambiguity at all about where a statement begins and ends. It's certainly not going to be the case that one tab too many or a space instead of a tab wrecks everything. Explicit is supposed to be better than implicit, right? I can't think of anything more implicit than using whitespace as syntax.
My personal bias is that whitespace is meant to make code human readable. It shouldn't matter to the interpreter, or at least, it shouldn't be critical to the degree that it seems to be for Python.
Of course I say this knowing perfectly well that Pythonists look at C code with its braces and think it's redundant and noisy.
- harry8 12y agoJust so you can laugh at me. Hahaha. That's the one thing I really do like about python. It means any difference in the shape of python code tells you something other than a personal preference of a coder I shouldn't have to know or care about. The consistency of the signal you get from the shape of the code makes this signal useful across codebases. That signal has a lot more noise in it in C & Perl for example. Anyone who talks about automatic indent compensating for it has never worked with jerks using different styles or hasn't had to hack a 3rd party library source to find a bug. No really. Make clang tools will be better but that's a long bow to assume yet. I have never once ever under any circumstances had a goddamn meeting where people argued about python bracing rules for code consistency. That alone makes it a truly epic ultra-megawin, for mine. (*but they absolutely should have standardised on ONE of tabs or spaces and I hate not being able to bounce on the braces to see where that awful code's scope actually starts and who wrote this anyway sweary curse I'm a teapot...).
- tjradcliffe 12y agoThe whole "OMG it's full of whitespace" thing kept me off Python for years, in part because I'd done a lot of work in text processing in the '90's and realized, "Whitespace is not actually evil... it is just misunderstood" was a fair encapsulation of the problem of whitespace parsing, where "equivalant" and "ignorable" whitespace were perennial problems. Once I got over that, Python turns out to be pretty awesome, and while I still use C++ for performance-critical things and C for firmware, the clarity and simplicity of Python is unmatched by any of the other dozen-odd languages I've written in. I agree syntactic whitespace comes with an overhead, but it's more than worth it for the other benefits you get with Python, particularly the ease of using every other library and language on the planet, from lapack to R.