
Spice up your JavaScript with currying - 3v0k4
https://medium.com/@riccardoodone/spice-up-your-javascript-5314bf28f3e5
======
ralusek
Am I the only person that absolutely hates this style of programming?
Explicitly passing arguments makes it much clearer to the reader what that
function does without having to go investigate the arguments it's expecting.
Similarly, while with map, filter, reduce, we're familiar with the arguments
they'll invoke our fn with, in other cases additional readability is lost by
not being able to name the arguments.

I would go further and argue that my favorite functions actually expect
objects with keys as parameters, so then it becomes clear what key the
function is expecting, and what value I'm passing from my business logic that
I'd like to represent that value.

    
    
        http({
          method: 'post',
          url: company.url.complaints
        })
    

I can tell by reading this code that I'm passing in a url and an http method
without knowing anything about the function's arguments or positions, and I
have explicitly mapped what value from my business logic I would like
associated with a specific argument key.

JS and Python, among others, have destructuring/kwargs to help this style of
programming be less verbose and equally self descriptive.

The other thing I really dislike about currying and positional arguments is
that it's very hard to change the function interface. Using keyed arguments
makes it trivial to add additional functionality to functions later without
breaking any existing code.

I just really can't get past the opinion that people are deluding themselves
into taking certain aspects of functional programming and not realizing
exactly how inconvenient it becomes to understand what's happening without
inspecting the interface of every function.

~~~
johnhenry
You are not alone...

