Earlier quoted context omitted.
Map/filter are considered inferior in Python to list comprehensions. res = [x**2 for x in range(10) if x != 5]
Before Ruby introduced filter_map: res = (1..10).select { |x| x != 5 }.map { |x| x ** 2 } With filter_map: res = (1..10).filter_map { |x| x ** 2 if x != 5 } In both cases, I think the Ruby solution is more readable. Python list comprehensions invert the subject (data) and the verb (action). You see what will be done before you see what the subject is. I would argue that showing the subject first allows easier code re…
I disagree and I’ve used both professionally for about the same amount of code.