Re:Verb-Noun vs. Noun-Verb
by saagarjha on Wednesday October 16, 2019 @02:51PM
(#21273978)
I also think that the object-oriented syntax matches my thinking process more closely: for example, I have an array of strings, and I want to convert them to numbers, pick only the odd ones then sum them rather than "I want to sum some things…things which I'm filtering by parity…which are actually strings I'm converting to integers".
[ Parent
| on HN ]
Re:Verb-Noun vs. Noun-Verb
by scarejunba on Wednesday October 16, 2019 @03:16PM
(#21274277)
That's how the thread-last/first macros help in Clojure. You sort of specify a pipeline:
``` (-> list parseInt isOdd sum) ```
Is the same as
``` (sum(isOdd(parseInt(list))) ```
Particularly useful if you're pulling a deeply nested key out.