<s>
A	O
computer	O
programming	O
language	O
is	O
said	O
to	O
adhere	O
to	O
the	O
off-side	B-Language
rule	I-Language
of	O
syntax	O
if	O
blocks	O
in	O
that	O
language	O
are	O
expressed	O
by	O
their	O
indentation	O
.	O
</s>
<s>
This	O
is	O
contrasted	O
with	O
free-form	B-Language
languages	I-Language
,	O
notably	O
curly-bracket	O
programming	O
languages	O
,	O
where	O
indentation	O
has	O
no	O
computational	O
meaning	O
and	O
indent	O
style	O
is	O
only	O
a	O
matter	O
of	O
coding	O
conventions	O
and	O
formatting	O
.	O
</s>
<s>
Peter	O
Landin	O
,	O
in	O
his	O
1966	O
article	O
"	O
The	B-Language
Next	I-Language
700	I-Language
Programming	I-Language
Languages	I-Language
"	O
,	O
defined	O
the	O
off-side	B-Language
rule	I-Language
thus	O
:	O
"	O
Any	O
non-whitespace	O
token	O
to	O
the	O
left	O
of	O
the	O
first	O
such	O
token	O
on	O
the	O
previous	O
line	O
is	O
taken	O
to	O
be	O
the	O
start	O
of	O
a	O
new	O
declaration.	O
"	O
</s>
<s>
The	O
following	O
is	O
an	O
example	O
of	O
indentation	O
blocks	O
in	O
Python	B-Language
.	O
</s>
<s>
The	O
colons	O
are	O
part	O
of	O
the	O
Python	B-Language
language	I-Language
syntax	O
for	O
readability	O
;	O
they	O
are	O
not	O
needed	O
to	O
implement	O
the	O
off-side	B-Language
rule	I-Language
.	O
</s>
<s>
In	O
Python	B-Language
,	O
the	O
rule	O
is	O
taken	O
to	O
define	O
the	O
boundaries	O
of	O
statements	O
rather	O
than	O
declarations	O
.	O
</s>
<s>
Python	B-Language
also	O
suspends	O
the	O
off-side	B-Language
rule	I-Language
within	O
brackets	O
.	O
</s>
<s>
In	O
this	O
dictionary	B-Application
,	O
the	O
keys	O
are	O
indented	O
,	O
and	O
a	O
list	O
is	O
split	O
between	O
four	O
lines	O
.	O
</s>
<s>
The	O
off-side	B-Language
rule	I-Language
can	O
be	O
implemented	O
in	O
the	O
lexical	B-Application
analysis	I-Application
phase	O
,	O
as	O
in	O
Python	B-Language
,	O
where	O
increasing	O
the	O
indenting	O
results	O
in	O
the	O
lexer	B-Application
outputting	O
an	O
INDENT	O
token	O
,	O
and	O
decreasing	O
the	O
indenting	O
results	O
in	O
the	O
lexer	B-Application
outputting	O
a	O
DEDENT	O
token	O
.	O
</s>
<s>
This	O
requires	O
that	O
the	O
lexer	B-Application
hold	O
state	O
,	O
namely	O
the	O
current	O
indent	O
level	O
,	O
and	O
thus	O
can	O
detect	O
changes	O
in	O
indentation	O
when	O
this	O
changes	O
,	O
and	O
thus	O
the	O
lexical	O
grammar	O
is	O
not	O
context-free	O
:	O
INDENT	O
and	O
DEDENT	O
depend	O
on	O
the	O
contextual	O
information	O
of	O
the	O
prior	O
indent	O
level	O
.	O
</s>
<s>
The	O
primary	O
alternative	O
to	O
delimiting	O
blocks	O
by	O
indenting	O
,	O
popularized	O
by	O
broad	O
use	O
and	O
influence	O
of	O
the	O
language	O
C	B-Language
,	O
is	O
to	O
ignore	O
whitespace	O
characters	O
and	O
mark	O
blocks	O
explicitly	O
with	O
curly	O
brackets	O
(	O
i.e.	O
,	O
{	O
and	O
}	O
)	O
or	O
some	O
other	O
delimiter	O
.	O
</s>
<s>
While	O
this	O
allows	O
for	O
more	O
formatting	O
freedom	O
–	O
a	O
developer	O
might	O
choose	O
not	O
to	O
indent	O
small	O
pieces	O
of	O
code	O
like	O
the	O
break	O
and	O
continue	O
statements	O
–	O
sloppily	O
indented	O
code	O
might	O
lead	O
the	O
reader	O
astray	O
,	O
such	O
as	O
the	O
goto	B-Protocol
fail	I-Protocol
bug	O
.	O
</s>
<s>
Lisp	B-Language
and	O
other	O
S-expression-based	O
languages	O
do	O
not	O
differentiate	O
statements	O
from	O
expressions	O
,	O
and	O
parentheses	O
are	O
enough	O
to	O
control	O
the	O
scoping	O
of	O
all	O
statements	O
within	O
the	O
language	O
.	O
</s>
<s>
The	O
explicit	O
structure	O
of	O
Lisp	B-Language
code	O
allows	O
automatic	O
indenting	O
,	O
to	O
form	O
a	O
visual	O
cue	O
for	O
human	O
readers	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
ALGOL	B-Language
60	I-Language
and	O
its	O
descendant	O
Pascal	B-Application
,	O
blocks	O
start	O
with	O
keyword	O
begin	O
and	O
end	O
with	O
keyword	O
end	O
.	O
</s>
<s>
In	O
some	O
languages	O
(	O
but	O
not	O
Pascal	B-Application
)	O
,	O
this	O
means	O
that	O
newlines	O
are	O
important	O
(	O
unlike	O
in	O
curly	O
brace	O
languages	O
)	O
,	O
but	O
the	O
indentation	O
is	O
not	O
.	O
</s>
<s>
In	O
BASIC	O
and	O
Fortran	B-Application
,	O
blocks	O
begin	O
with	O
the	O
block	O
name	O
(	O
such	O
as	O
IF	O
)	O
and	O
end	O
with	O
the	O
block	O
name	O
prepended	O
with	O
END	O
(	O
e.g.	O
,	O
END	O
IF	O
)	O
.	O
</s>
<s>
In	O
Fortran	B-Application
,	O
each	O
and	O
every	O
block	O
can	O
also	O
have	O
its	O
own	O
unique	O
block	O
name	O
,	O
which	O
adds	O
another	O
level	O
of	O
explicitness	O
to	O
lengthy	O
code	O
.	O
</s>
<s>
ALGOL	B-Language
68	I-Language
and	O
the	B-Device
Bourne	I-Device
shell	I-Device
(	O
sh	O
,	O
and	O
bash	B-Operating_System
)	O
are	O
similar	O
,	O
but	O
the	O
end	O
of	O
the	O
block	O
is	O
usually	O
given	O
by	O
the	O
name	O
of	O
the	O
block	O
written	O
backward	O
(	O
e.g.	O
,	O
case	O
starts	O
a	O
switch	O
statement	O
and	O
it	O
spans	O
until	O
the	O
matching	O
esac	O
;	O
similarly	O
conditionals	B-Language
if	O
...	O
then	O
elif	O
...	O
else	O
...	O
or	O
for	B-Language
loops	I-Language
for	O
...	O
do	O
od	O
...	O
in	O
ALGOL68	B-Language
or	O
for	O
...	O
do	O
done	O
...	O
in	O
bash	B-Operating_System
)	O
.	O
</s>
<s>
An	O
interesting	O
variant	O
of	O
this	O
occurs	O
in	O
Modula-2	B-Language
,	O
a	O
Pascal-like	O
language	O
which	O
does	O
away	O
with	O
the	O
difference	O
between	O
one	O
and	O
multiline	O
blocks	O
.	O
</s>
<s>
One	O
advantage	O
to	O
the	O
Fortran	B-Application
approach	O
is	O
that	O
it	O
improves	O
readability	O
of	O
long	O
,	O
nested	O
,	O
or	O
otherwise	O
complex	O
code	O
.	O
</s>
<s>
However	O
,	O
modern	O
source	B-Application
code	I-Application
editors	I-Application
often	O
provide	O
visual	O
indicators	O
,	O
such	O
as	O
syntax	O
highlighting	O
,	O
and	O
features	O
such	O
as	O
code	B-Application
folding	I-Application
to	O
assist	O
with	O
these	O
drawbacks	O
.	O
</s>
<s>
In	O
the	O
language	O
Scala	B-Application
,	O
early	O
versions	O
allowed	O
curly	O
braces	O
only	O
.	O
</s>
<s>
Scala	B-Application
3	O
added	O
an	O
option	O
to	O
use	O
indenting	O
to	O
structure	O
blocks	O
.	O
</s>
<s>
Designer	O
Martin	O
Odersky	O
said	O
that	O
this	O
improves	O
productivity	O
overall	O
by	O
10%	O
,	O
turns	O
out	O
to	O
be	O
the	O
most	O
productive	O
change	O
introduced	O
in	O
Scala	B-Application
3	O
,	O
and	O
advises	O
its	O
use	O
.	O
</s>
