3 ms·
Although point-free style achieves (or surpasses) the brevity of anaphoric style, it does so in a manifestly different way. To use two Ruby examples, (1..1
by raganwald 17y ago
Although point-free style achieves (or surpasses) the brevity of anaphoric style, it does so in a manifestly different way. To use two Ruby examples,
(1..100).map(&:to_s)
(1..100).map(&it.to_s)
The first example reads to me as mapping a method over the numbers, while the second reads to me as a very terse way of describing a function that sends a method to each number.
I am not doing a good job of explaining the difference in my head, but I do know that sometimes I really like point-free style because I am thinking in operations and methods rather than in functions.