<s>
Method	B-Language
chaining	I-Language
,	O
also	O
known	O
as	O
the	O
named	O
parameter	O
idiom	O
,	O
is	O
a	O
common	O
syntax	O
for	O
invoking	O
multiple	O
method	O
calls	O
in	O
object-oriented	B-Language
programming	I-Language
languages	I-Language
.	O
</s>
<s>
Method	B-Language
chaining	I-Language
eliminates	O
an	O
extra	O
variable	O
for	O
each	O
intermediate	O
step	O
.	O
</s>
<s>
Method	B-Language
chaining	I-Language
has	O
been	O
referred	O
to	O
as	O
producing	O
a	O
"	O
train	O
wreck	O
"	O
due	O
to	O
the	O
increase	O
in	O
the	O
number	O
of	O
methods	O
that	O
come	O
one	O
after	O
another	O
in	O
the	O
same	O
line	O
that	O
occurs	O
as	O
more	O
methods	O
are	O
chained	O
together	O
.	O
</s>
<s>
A	O
similar	O
syntax	O
is	O
method	O
cascading	O
,	O
where	O
after	O
the	O
method	O
call	O
the	O
expression	O
evaluates	O
to	O
the	O
current	O
object	O
,	O
not	O
the	O
return	B-Language
value	I-Language
of	O
the	O
method	O
.	O
</s>
<s>
Cascading	O
can	O
be	O
implemented	O
using	O
method	B-Language
chaining	I-Language
by	O
having	O
the	O
method	O
return	O
the	O
current	B-Application
object	I-Application
itself	I-Application
.	O
</s>
<s>
Cascading	O
is	O
a	O
key	O
technique	O
in	O
fluent	O
interfaces	O
,	O
and	O
since	O
chaining	O
is	O
widely	O
implemented	O
in	O
object-oriented	B-Language
languages	I-Language
while	O
cascading	O
is	O
n't	O
,	O
this	O
form	O
of	O
"	O
cascading-by-chaining	O
by	O
returning	O
"	O
is	O
often	O
referred	O
to	O
simply	O
as	O
"	O
chaining	O
"	O
.	O
</s>
<s>
Both	O
chaining	O
and	O
cascading	O
come	O
from	O
the	O
Smalltalk	B-Application
language	O
.	O
</s>
<s>
This	O
prevents	O
the	O
return	B-Language
value	I-Language
from	O
being	O
used	O
for	O
some	O
other	O
purpose	O
,	O
such	O
as	O
returning	O
an	O
error	B-Application
value	I-Application
.	O
</s>
<s>
A	O
common	O
example	O
is	O
iostream	O
in	O
C++	B-Language
,	O
where	O
for	O
example	O
<<	O
returns	O
the	O
left	O
object	O
,	O
allowing	O
chaining	O
.	O
</s>
<s>
Another	O
example	O
in	O
JavaScript	B-Language
uses	O
the	O
built-in	O
methods	O
of	O
Array	O
:	O
</s>
