|
|
|
|
|
by jfaucett
3901 days ago
|
|
"Chaining or nesting a series of function calls, depending on the language, can be more readable still than the variables approach and at the same time more concise". Couldnt agree more, variables are just clutter you have to keep mental track of, and working with series of transformations is much easier (for me at least) to process. I would be interested to know if its like this for all developers, perhaps not, since I know some that are also opposed to recursion. but for me this: sum([]) = 0.
sum([H|T]) = H + sum(T).
is much easier to understand than: function sum(ary) {
var i = ary.length,
res;
while(--i) {
res += ary[i];
}
return res;
}
|
|