by jen20 · 4y ago · 0 comments
Although I hate functional options for their lack of discoverability, the idea that currying is "awful" is pretty far fetched.
Currying in languages that use different syntax is orthogonal to the point being made here.
For example, compare these two functions:
function (a, b) { return a + b; }
function create_adder(a) { return function(b) { return a + b;}}
The purpose of first function is easier to understand. And if you rewrite last function according to modern trends, it can become even less readable:
const create_adder = (a) => (b) => a + b;
Also, if you start a function with a word 'const' then it is less obvious that this is a function and not just a constant. In contrast, if you use a word 'function', then you understand what it is from the first word.
A function is “just” a constant.