Correct me if I'm wrong, but [1, 2, 3, 4, 5].select(&:even?) should actually be slower than explicitly writing a block, as it creates a Proc object implicitly by calling to_proc on the Symbol. There might of course be some optimization going on in the background that I don't know about. (EDIT: I totally agree that it looks neater though, and I use it a lot myself)
[1, 2, 3, 4, 5].select(&:even?)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.