4 ms·
But it's not. "partial" is specifically defined as its own function in the article. If you're a developer coming across this guy's project for the first time,
by jasonkester 9y ago
But it's not. "partial" is specifically defined as its own function in the article. If you're a developer coming across this guy's project for the first time, you'll have to dig one level further into the stack before you find it.
Only then do you get to learn those unnecessary gymnastics, so you can follow the rest of his code.
- avmich 9y ago"partial" is an idea which is known in programming, specifically functional one, and its use is much wider than this particular example. It's just that JavaScript doesn't have this standard it has to be defined. Similarly a concept of "function" is a widely known one, which you also need to learn. The whole article makes sense as telling something new to the one who doesn't know what's the point-free style is - but might know what the partial application is. It's a feature, not a bug when something is learned as the result of reading the article and can be applied later.
- lmm 9y agoIf "partial" were only usable for this one function you'd be right. But actually it's a very common, general function (under various names); in many languages it's already present in the standard library, or at least in an established library that's commonly used. Fundamentally this is what programming is all about - finding the commonality that you can pull out and reuse, rather than doing every single case by hand.