Slashdot videos: Now with more Slashdot!
Technically speaking, whitespace is just another character, so there is no reason to conceptually differentiate it from a brace.
What? There is every reason to differentiate it from a brace. A brace is a clear indicator of something. Whitespace is
Whitespace isn't "nothing." That depends on the implementation. You mention yourself that it's a delimiter for tokens. I have seen tokens delimited with semi-colons, commas, and other characters. What makes whitespace so special? My point was that whitespace is a valid character and can be used just like a brace despite its semantic meaning in human language.
A compiler sees whitespace just as it sees braces,
What utter nonsense. Maybe a "python compiler" does it that way, but I know of no other compiler that puts any such syntax upon whitespace. Not C, not Fortran, not Cobol. No other language I know of does this. Whitespace is simply ignored (except in limited cases like "within a string constant", but that's not a syntactical interpretation of whitespace).
Yes, you're right about that. I wasn't claiming that other compilers attribute meaning to whitespace. I was pointing out that all compilers see whitespace just as they see a brace -- simply another character in the set -- although what they do with it is different: most discard it, while Python uses it.
On a site note, I work with Java for a living and I often find myself wishing my co-workers would effectively use whitespace.
This should point out to you the fact that whitespace is a VISUAL concept, not a computer concept, and that different people use it in different ways, because "looks right" is a subjective and not objective goal. Compilers should not care if the code "looks" right, and people should not have to care if the compilers "sees" the code.
Good point, but I think programming for humans is just as important as programming for computers. If the code isn't readable by both, then someone has failed. Using your logic, I could just as easily claim that using punctuation in English is unnecessary because it doesn't alter the meaning of a sentence.
Any language that depends on whitespace to delimit blocks of code (e.g., the code belonging to an IF or FOR loop) is poorly defined. Whitespace exists for visual depictions of code, not internal.
And that's a perfectly valid argument, but it is still just a concept imposed solely because of previous standards. Technically speaking, whitespace is just another character, so there is no reason to conceptually differentiate it from a brace. A compiler sees whitespace just as it sees braces, but we have traditionally not parsed that whitespace. Python simply uses that whitespace rather than discarding it. On a site note, I work with Java for a living and I often find myself wishing my co-workers would effectively use whitespace. It's amazing how some people honestly don't see anything wrong with code that is unreadable by humans. At least Python makes this type of code much less likely.