help explaining rationale for indentation
Rainer Deyke
root at rainerdeyke.com
Wed Aug 23 01:17:02 EDT 2000
"Grant Griffin" <g2 at seebelow.org> wrote in message
news:39A2EA36.8DC7746 at seebelow.org...
> If we all lived in a programming world where indentation was the norm
> (BTW, why hasn't anybody ever offered a braceless version of C/C++), I
> think braces would be a *VERY* tough sell. People would say, "Why do we
> need that?--all it does is clutter our code and lead to multiple ways of
> writing the same thing."
One potential advantage of braces (or analogous syntactical elements) is
that they allow a higher degree of structural flexibility. For example, it
might be possible to embed statements in expressions (not just the other way
around) in a language that uses them. I personally think it would be nice
if Python did not need separate 'def's and 'lambda's. Imagine the
following, where 'function' is a hypothetical new keyword:
map(something, function(x) { print x; })
In pragmatic everyday programming, however, I prefer the brace-less Python
style.
--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor
More information about the Python-list
mailing list