Indentation constraints and Python design

rafael on 2006-02-13T10:06:05

Interesting quote by Guido about the language design principles that guide python's evolution :

I find any solution unacceptable that embeds an indentation-based block in the middle of an expression. Since I find alternative syntax for statement grouping (e.g. braces or begin/end keywords) equally unacceptable, this pretty much makes a multi-line lambda an unsolvable puzzle. -- Language Design Is Not Just Solving Puzzles
(via LtU)

So, choice of basic grammar rules has an influence on language features -- nothing really new here. Perl 5 and Perl 6 have complex, expressive syntax, where blocks in expressions are familiar, because easy to do. That doesn't mean they're necessarily superior at every point of view. But that shows they're optimized for versatility; while Python's grammar is constantly changing, sometimes without ensuring backwards compatibility. In Perl 5 you can have idioms, or new programming paradigms (look at how Catalyst uses attributes for example), while being able to run Perl 4 scripts. That would be another advocacy point. Get the new cool stuff without throwing away the old one.