[bitc-dev] On whitespace sensitivity (was Re: Opinions wanted: Infix shift operators)
wren ng thornton
wren at freegeek.org
Mon Aug 9 01:58:51 PDT 2010
William Leslie wrote:
>> When programming in Python, my intuitions are constantly thwarted in one
>> way or another. E.g., requiring line-final backslashes to do line
>> wrapping is a gross hack;
> If you need to use that you probably have other problems. Line
> continuation is implicit inside parenthesis, braces and brackets,
> which is the only place you'd ever want them.
Not in my experience. Why should I add extraneous parentheses around a
top-level expression, like a summation or product of a bunch of
parameters, as in statistical number crunching? For casual scripting
where most of your statements are small atomic actions, Python suffices;
but whenever the program becomes mathematically intricate or requires
descriptive names, it's very easy to hit the 80 character limit without
involving parens, braces, or brackets.
> But then you are really talking about python treating newline as a
> statement delimiter, not about indentation. I think that newline makes
> a very intuitive statement delimiter.
It's all the same thing: the use of whitespace as semantically
meaningful for determining the boundaries of statements and blocks. As I
said earlier, I think Haskell's solution is far more successful and
intuitive than simply replacing the semicolon or period with a \n.
More information about the bitc-dev