Final thoughts
Let's finish this chapter with two more philosophical considerations regarding currying and partial application, which may cause a bit of a discussion:
- First, that many libraries are just wrong as to the order of their parameters, making them harder to use
- Second, that I don't usually even use the higher-order functions in this chapter, going for simpler JS code!
That's not probably what you were expecting by this time, so let's go over those two points in more detail, so you'll see it's not a matter of do as I say, not as I do or as the libraries do!
Parameter order
There's a problem that's common to not only functions such as Underscore's or LoDash's _.map(list, mappingFunction)
or _.reduce(list, reducingFunction, initialValue)
, but also to some that we have produced in this book, as the result of demethodize()
, for example. (See the Demethodizing: turning methods into functions section of Chapter 6, Producing Functions - Higher-Order Functions, to review that higher-order function...