|
|
|
|
|
by ionforce
4338 days ago
|
|
It is a guarantee to you that the data structure has not been tampered with by the time it reaches you. // pseudo code
var fruitBasket = new FruitBasket('banana, 'apple)
muckWithFruits(fruitBasket)
suspiciousLogger(fruitBasket)
weirdCallback(fruitBasket)
// here
assert(fruitBasket.length == 2)
By the time we reach "here", we know that none of the functions since the inception of fruit basket have tampered with it.This may not be a big deal if you are disciplined about never modifying your source data, but this moves the guarantee from a soft one to a mechanical one. And then there's all this typical stuff about functional programming blah blah... But that's the most practical example I can think of. |
|