4 ms·
I've barely used the dot syntax since Kernel.then was added. It's good that it exists even if you never use it.
by lvass 3y ago
I've barely used the dot syntax since Kernel.then was added. It's good that it exists even if you never use it.
- paradox460 3y agoThen is really nice. I always used to write "clean" pipelines in my gen server and such, that ended in an anon function to return the needed tuple for the respective handlers. Inevitably we'd get a squabble in the code review, where some wanted everything put in a variable then the explicit tuple at the end, while others agreed that the dot syntax, while a bit odd and line-noisy, was ultimately better Then solved that. The line noise complaints went away, code readability went up, and everyone was happy
- conradfr 3y agoYes the syntax to pipe the first argument to an anonymous function for another function and use it as second+ argument was akward and hard to remember. Like: "hacker news" |> (&Map.put(:site, "ycombinator", &1)).()