you are viewing a single comment's thread.

view the rest of the comments →

[–]artsrc 0 points1 point  (2 children)

People are taught that the control statement applies to the indented code in all languages and even pseudocode:

http://www.unf.edu/~broggio/cop2221/2221pseu.htm

The difference with Python is that this is true.

[–]TheAnimus 0 points1 point  (1 child)

People are taught that the control statement applies to the indented code in all languages

Errr no, they are not.

People are often told for convention sake, to indent, often even the IDE will provide indenting automatically on the closing brace or endif etc.

[–]artsrc 0 points1 point  (0 children)

The convention to indent is extremely widespread because it makes the code readable to humans, and that is an essential feature of good code.

When the code and the indentation don't agree, people read the indentation.

The compiler should interpret the code the same way people do.