3 ms·
Consider you have two of these things close together: [10, 11, 12].map{|x| x.to_s(16)} [:baz, :bam, :bar].map{|x| x.to_s(16)} At least for me, I tie the '
by cirwin 14y ago
Consider you have two of these things close together:
[10, 11, 12].map{|x| x.to_s(16)}
[:baz, :bam, :bar].map{|x| x.to_s(16)}
At least for me, I tie the 'x's together in my head; so I have to concentrate to realise that there are two different 'x's.
I've not done any formal research into this, it would be interesting to see whether there's actually a perceivable difference between the two styles.
- stuffihavemade 14y agoI would never stop to think that the x's could be the same. The fact the {} instead of do syntax is used and the fact that the parameter is called 'x' instead of something more descriptive tells me that I shouldn't be concerned with the parameter itself.