Re:My Objection to Array#sum
by nostrademons on Thursday April 09, 2009 @05:54PM
(#555240)
OTOH, in languages that support first-class functions, it's pretty common to put the functional argument last because then it can wrap to another line without leaving dangling parameters:
That's putting the most complicated object last, and feels much more natural than:
I suspect it's more that English has trained us to read "noun verb object" sentences. In an if statement, `foo` feels like the subject, and then "== NULL" is the predicate. In an array map, the array is the subject, and the function is the predicate. In the Python join example, the array feels like the subject, "join" is the verb, and "," is the object, which is what makes it seem so awkward. Ruby's array.sum feels more natural because the array is the subject and sum is an intransitive verb.
[ Parent
| on HN ]
There are no comments on this comment yet.