3 ms·
Guido van Rossum dislikes map and filter: > I value readability and usefulness for real code. There are some places where map() and filter() make sense, and fo
by esafak 3y ago
Guido van Rossum dislikes map and filter:
> I value readability and usefulness for real code. There are some places where map() and filter() make sense, and for other places Python has list comprehensions. I ended up hating reduce() because it was almost exclusively used (a) to implement sum(), or (b) to write unreadable code.
https://developers.slashdot.org/story/13/08/25/2115204/interviews-guido-van-rossum-answers-your-questions https://developers.slashdot.org/story/13/08/25/2115204/inter...
Also, comprehensions are inspired by set-builder notation.
https://en.wikipedia.org/wiki/Set-builder_notation https://en.wikipedia.org/wiki/Set-builder_notation
- corethree 3y agoGuido isn't a functional programmer. He doesn't know the trade off. The benefits of functional programming are less technical debt and greater modularity and less bugs. The cost is less readability and less efficiency. Reduce is ultimately the most readable way to iterate and accumulate with FP. The only other way would be recursion which is less readable.
- odyssey7 3y agoThis is fascinating context.