Talk:Off-side rule

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Computing (Rated Start-class)
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.

Specific or general[edit]

The page doesn't specify whether "the off-side rule" refers to this particular definition of using indent to signify blocks, or any such ruleset. — Preceding unsigned comment added by (talk) 21:58, 29 July 2015 (UTC)

Origin and meaning[edit]

I tried looking at the various sporting uses of "off-side", but couldn't see any obvious conceptual link to the indentation rule use. Where, and how, did it originate? --Piet Delport 09:55, 26 December 2005 (UTC)

I'm not sure I understand your question, and perhaps you saw this already, but the cited article by Landin includes the following:
(c) Indentation, used to indicate program structure. A physical ISWIM can be defined in terms of an unspecified parameter: a subset of phrase categories, instances of which are restricted in layout by the following rule called "the offside rule." The southeast quadrant that just contains the phrase's first symbol must contain the entire phrase, except possibly for bracketed subsegments. This rule has three important features. It is based on vertical alignment, not character width, and hence is equally appropriate in handwritten, typeset or typed texts. Its use is not obligatory, and use of it can be mixed freely with more conventional alternatives like punctuation. Also, it is incorporated in ISWIM in a systematic way that admits of alternatives without changing other features of ISWIM and that can be applied to other languages.
Conclusions of the article end in the following paragraph:
It is assumed that future calls on language development cannot be forstalled without generalizing the alternatives to explicit sequencing. The innovations of "program-points" and the "off-side rule" are directed at two of the problems (respectively in the areas of semantics and syntax) that must consequently be faced.
--TuukkaH 16:56, 26 December 2005 (UTC)
OK, that shows the term being coined, but still without any explanation of why is it called the "off-side" rule. I assume the name is intended to carry the connotations of some existing concept, but what is it? --Piet Delport 12:43, 31 December 2005 (UTC)
Right. We can come up with some possible explanations :-) There's off-shore and off-road meaning away from a thing, so off-side could be "away from the side, indented". Perhaps there were other indentation rules already, and Landin wanted a distinct name? How could we know what Landin really thought? We can hope we find him explaining this :-) --TuukkaH 15:23, 31 December 2005 (UTC)

Some comments[edit]

With regard to the discussion above, about the connection with the sporting meaning of "off-side", I'll point out that in the sport known as "soccer" in the USA, and "football" everywhere else in the known universe, the offside rule is generally acknowledged as the hardest to understand and to explain to outsiders. It is, nevertheless, a crucial rule whose abolition changes the game entirely.

But that's not what brought me here. The page has the following:

"(note also the obligatory colons — they are merely syntactical markers to make it easier to read)"

Are you sure you mean "obligatory"? Perhaps you mean "traditional". It's not possible for something to be both obligatory and optional at the same time.

Also, the article is still marked as a stub, although I can't think of anything much that needs adding to it. I suggest that the "stub" template be removed.--Nyelvmark 00:24, 8 September 2007 (UTC)

Colons aren't optional. What the quote is means is that they aren't nescessary to make the language interpretable, but are in the language simply to make it more readable. Ragzouken 13:35, 16 October 2007 (UTC)

It's amazing how the omission of such a small word - "not" - can make such a big difference. Fortunately, someone has now quietly added it, converting a piece of execrable time-wasting garbage into a piece which may be useful to somebody, someday (if, indeed, it's now accurate).


Although it may apply to the Python language, the term is very seldom used within the community. --Paddy (talk) 04:02, 20 February 2008 (UTC)

Left versus right[edit]

At I don't doubt the historical accuracy of the Landin quote, but hasn't he confused left for right? That is to say, isn't this

an example of what he describes using the word left?

I think he means, by "start of a _new_ declaration", that one is no longer inside the old one (which would be the inner scope). Although it's really not understandable. -- (talk) 22:09, 29 July 2015 (UTC)

Hasn't Landin in fact (by using "left" instead of "right") inadvertently described OUTdenting? Xojo (talk) 19:15, 30 July 2009 (UTC)

No, advertently. See the previous comment. The rule defines when a declaration starts by defining when the previous one finishes. (Actually, in Python he would mean a statement rather than a declaration, but that's a separate issue...)

Main advantage of curly braces[edit]

A section needs to be rewritten.

Regarding the C-style curly braces instead of indenting, the article says "The main advantage of this is that it makes it possible for tools to correct the indentation automatically."

That isn't an *advantage* of the alternative, it's a crutch that people use to make their code more readable. An advantage of this alternative might be that it is up to the developer to indent however they need to -- including not indenting shorter blocks if they want, while still indenting longer blocks. Another advantage might be that it makes parsing of the language a little easier. — Preceding unsigned comment added by (talk) 18:15, 25 July 2012 (UTC)

exactly, that’s stupid: if the program doesn’t compile when indented incorrectly, there’s no reason for relying on a tool that corrects indentation, correct indentation is simply enforced. I’ll delete that part and replace it with the arguments you mention. — Flying sheep (talk) 19:48, 2 January 2013 (UTC)

aka "syntactically significant whitespace"[edit]

I think "syntactically significant whitespace" is standard term for this, including in Python community. (talk) 16:52, 25 March 2014 (UTC)

Merge with "Free-form language"[edit]

This page should be merged with Free-form language under a neutral name like "whitespace significance" or "block syntax". Jruderman (talk) 11:00, 28 December 2014 (UTC)

Not exactly correct: Python syntax is "Off-side rule" but it isn't Free-form language.
"Off-side rule" is not widely used among programmers and poorly sourced. Ushkin N (talk) 05:41, 22 May 2016 (UTC)

Off-side or offside?[edit]

I can see that Landin did indeed spell it off-side in his Next 700 Porgramming Languages paper in 1965. But it looks to me like sources today (including a couple I just added) tend to spell it as a single word. In Google searches for Landin "offside rule" versus Landin "off-side rule", the unhypenated spelling is 1.48x as frequent on the web (4,680 hits versus 3,170 hits) and 4.55x as frequent in books(182 hits versus 40 hits), This isn't a huge difference but per WP:COMMONNAME, I believe it might be enough to justify renaming the article Offside rule (programming). Opinions, please? Msnicki (talk) 17:10, 3 September 2015 (UTC)