News for hackers. Stuff that matters.
Re:When Does Point-Free Notation Make Code More Readable? by randallsquared on Friday September 29, 2017 @10:34AM (#15365612)
Well, it isn't like you can avoid understanding B by using A: A adds a concept, but it doesn't remove any of the existing ones; it just makes you do B in your head when you see A to arrive at the concept which is reified in the function name.

Even if you're only using it in one place, `atLeastTwo(some_value)` is simpler than `partial(Math.max, 2)(some_value)` in at least that way.

Re:When Does Point-Free Notation Make Code More Readable? by avmich on Friday September 29, 2017 @11:09AM (#15365947)
I'd argue that they are the same. Calculating return value of B (return Math.max(2, someNumber)) is calling Math.max with two arguments, the second of which is explicitly named. The result is the same as partial(Math.max, 2)(someNumber). someNumber isn't used anywhere else, and the function itself just does the supplement of someNumber as second argument to Math.max . That's also what partial(Math.max, 2) does.