5 ms·
> It means no multi-line lambdas so you end up with these unreadable list comprehensions `[ sub_item.value for sub_item in item.sub_items in items if item.is_th
by pansa2 7y ago
> It means no multi-line lambdas so you end up with these unreadable list comprehensions `[ sub_item.value for sub_item in item.sub_items in items if item.is_the_best ]`
How would you rather write that code? Is it lack of multi-line lambdas that stops you from writing it as you would like?
- deleted 7y ago[deleted]
- ulucs 7y agoitems .select(&:is_the_best) .flat_map { |i| i.sub_item.map(&:value) } Not having functional constructs really hurts readability, and I don't want to think about what would happen to the list comprehension with more complicated logic