|
|
|
|
|
by Groxx
3426 days ago
|
|
I dunno, ruby has some nice tendencies here, like `out = [1,2,3].map(&:to_s)` which is small and descriptive[1]. Compare that to: out = []
[1,2,3].each do |x|
out.append(x.to_s)
end
IMO that's not fad material - that's progress. Maps and folds can totally be abused to produce inscrutable nonsense, but for small, common operations they're often much more obviously-correct.[1]: `&:method_name` is extremely-common shorthand for "call this method" |
|