2 ms·
> and this creates mental strain for everybody who has to read it. Really? I find it just the opposite. List comprehensions are broadly welcomed instead of one
by falcolas 11y ago
> and this creates mental strain for everybody who has to read it.
Really? I find it just the opposite. List comprehensions are broadly welcomed instead of one- or two-line for loops, lambdas are quite useful in the right context (such as sorting, list comprehensions, etc), and functions are a first class citizen, and easily used (and recognized) as such.
It just lets me use the right tool for the job, without having to switch languages. And since the functional bits have been baked in for so long, it's easy to do.
And let's be fair, you can't say that there's cognitive overhead to functional programming in Python while claiming Ruby does not. Both languages have nearly identical capabilities in this regard (though, I do miss Ruby's multi-expresssion lambdas when in Python).