4 ms·
> An often better alternative to chaining is composition It's not explained, but one of the reasons why is that function composition refactors more easily than
by platz 12y ago
> An often better alternative to chaining is composition
It's not explained, but one of the reasons why is that function composition refactors more easily than chained code. The first operand (i.e. the value) in the chained code alters the semantics of all the subsequent chained code. You cannot replace parts of the chain as easy as you can with vanilla function composition; you always have that first value to worry about, and this reduces reusability slightly (compared to composition)
- deleted 12y ago[deleted]