Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



I 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.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: