9 ms·
You tell me. Seems like most functions can be eliminated and just replaced by comprehensions or a series of map, reduce, filters, sort, comparisons, etc, with s
by xwdv 4y ago
You tell me. Seems like most functions can be eliminated and just replaced by comprehensions or a series of map, reduce, filters, sort, comparisons, etc, with small operations applied per element.
- yCombLinks 4y agoSure, they could. But I find naming these things explains to future users the point of why you're applying all of these functions. A chain of 10 filters / maps / comparisons / etc... do 0 to explain why a program cares about doing those things.
- xwdv 4y agoIf it is a true pure function that has already been proven and tested to be correct, you only need to be concerned with the output. The function itself will never have side effects you need to understand nor will it ever change.
- yCombLinks 4y agoRequirements change. I need a function that takes the same input, but the output is no longer valid. But I can't look at this "incredible pure function" and figure out how to do that.