4 ms·
But isn't that true for functions in general? types may help you mitigating some of those bugs, but the real way to solve the issue is with good documentation:
by pera 9y ago
But isn't that true for functions in general? types may help you mitigating some of those bugs, but the real way to solve the issue is with good documentation: docstrings and well-named parameters is the way to go.
- cle 9y agoYes it is also true for functions in general, which is why you shouldn't have functions with lots of arguments (and especially lots of arguments with the same type). Currying exacerbates the problem because the function application doesn't occur in one place--not only do you have to get the ordering right, but the order in which the function is applied is scattered across your code and depends on the control flow. It's a neat trick, but most of the time it significantly reduces the clarity and maintainability of a program.