5 ms·
Not fond of significant white space?
by peterashford 12y ago
Not fond of significant white space?
- krapp 12y agoHonestly, 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.
- shmerl 12y agoI really don't like the idea of using fixed length of whitespace for delimiting scope instead of using explicit markers. It's not really a language issue, just syntax preference.
- spacecowboy_lon 12y agoIt always reminds me of the old Punchcard Fortran fixed column layout " Columns 1 to 5 were the label field: a sequence of digits here was taken as a label for the purpose of a GOTO or a FORMAT reference in a WRITE or READ statement. Column 6 was a continuation field: a non-blank character here caused the card to be taken as a continuation of the statement on the previous card. Columns 7 to 72 served as the statement field"
- maxlybbert 12y agoIf you ever screw up the whitespace, it's possible that the mistake won't show up in common diffing software, because most diffing software is designed with the assumption that whitespace is insignificant (and hard to display).
- coldtea 12y agoSo they should just have made tabs compulsory. Problem solved.
- krapp 12y agoIronically, as soon as you need a tool to make whitespace visible in order to determine which delimiter you're using where, you're just using C-style braces again, only now there are two kinds of braces, which are incompatible, and otherwise visually indistinguishable.