Python Indentation Syntax Terminology: “Off-Side Rule”

, , …,

One of the name for indentation-based syntax such as Python is off-side rule.

According to Wikipedia, the term came from a article titled The Next 700 Programming Languages, published in the Communications of the ACM in 1966, written by computer scientist Peter J. Landin (b1930).

Peter defined the off-side rule thus: “Any non-whitespace token to the left of the first such token on the previous line is taken to be the start of a new declaration.”

With respect to the quality of a terminology, that's not a good term. Because it's rather opaque. You read the term, and you wouldn't understand what it means. A better one would be “indentation based nesting syntax”. Such syntax belongs to the general category of “layout-based syntax”.

blog comments powered by Disqus