News for hackers. Stuff that matters.
Re:When Does Point-Free Notation Make Code More Readable? by jasonkester on Friday September 29, 2017 @10:48AM (#15365745)
A is objectively more complex:

B gives you all the information you need to know what's going on.

A requires you to go dig up what "partial" is doing (which, it turns out is itself doing some wacky gymnastics to turn one of its arguments into a function and the other into a parameter (and the parameter of whatever gets passed into the returned function as the other parameter of the function that was originally passed in).

Observe how much writing it took just to describe what's going on with your "A". No explanation at all is required for B. It's complete as written. Simple, and intuitive all in one.

Re:When Does Point-Free Notation Make Code More Readable? by avmich on Friday September 29, 2017 @10:58AM (#15365860)
"partial" is an independent concept, which could be learned once and applied after that just as "function" can be in example B. You don't say that "function" and "return" are doing some wacky gymnastics in the code do you?

It takes a lot to describe what's going on with A because it's a relatively new concept, related to the subject of the article. If partial application would be just as well known as function definition, the explanation could be shorter.

Re:When Does Point-Free Notation Make Code More Readable? by jasonkester on Friday September 29, 2017 @11:01AM (#15365883)
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.

Re:When Does Point-Free Notation Make Code More Readable? by lmm on Friday September 29, 2017 @11:27AM (#15366113)
If "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.

Re:When Does Point-Free Notation Make Code More Readable? by avmich on Friday September 29, 2017 @11:17AM (#15366011)
"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.

Re:When Does Point-Free Notation Make Code More Readable? by moomin on Friday September 29, 2017 @10:54AM (#15365807)
I think you're confusing the concept of "complex" with "harder for me to process".

There are many, many things that are /simple/ that are actually pretty hard to understand. Most of higher maths, for instance.

Re:When Does Point-Free Notation Make Code More Readable? by savanaly on Friday September 29, 2017 @11:34AM (#15366182)
A only seems more complex because you're not used to the concepts involved. If you were then it would seem less complex than writing it "longhand".
Re:When Does Point-Free Notation Make Code More Readable? by beaconstudios on Friday September 29, 2017 @11:00AM (#15365873)
if you're writing functional code, you should already know what partial application is - and the "partial" function is only necessary in this case because JS isn't a curried language by default.

your idea of B being more simple is largely driven by the fact that you likely have more experience writing code in that manner. With experience writing functional code you should find that both A and B are clear at a glance.