3 ms·
Inline conditionals can be a blessing and a curse. In this case, it is absoluteley alright to use them (I find it also more elegant). But I have also seen thing
by maze-le 9y ago
Inline conditionals can be a blessing and a curse. In this case, it is absoluteley alright to use them (I find it also more elegant). But I have also seen things like:
my_fancy_named_variable = my_array.map{|x| do_processing(x)}.sort_by{|x| x.value} unless some_very_long_conditional_that_breaks_readability
This is not very readable, and I would actually use multiple lines to format a call like this.