Why indentation is use to denote block of code?

Sean DiZazzo half.italian at gmail.com
Mon Sep 14 00:42:56 CEST 2009


On Sep 13, 3:12 pm, Peng Yu <pengyu... at gmail.com> wrote:
> Hi,
>
> I want to understand why python use indentation to denote block of
> code. What are the advantages of it? Is there a style in python to
> denote a block of code the same as that of C++ (with '{}')?
>
> One disadvantage of using indentation to denote a block of code is
> that the runtime to automatically indent a python code would be about
> a few times more than the runtime to automatically indent a C++ code
> of the same length (both are in vim).
>
> Regards,
> Peng

Looking at your other post regarding "strict mode", I have to
comment.  I think you are looking for a different language.  What you
are hoping to change about the language are some of the major things
that make it a joy to program for me.  Braces, static typing, no
indentation... What's next?  Would you like semicolons?

I suggest you spend some time just programming it the way it was made
to be programmed, and quit trying to turn it into Perl or any other
language.  If after a week or two, you don't like it, then move on.
And save us the complaints.

~Sean



More information about the Python-list mailing list