Re:Greenlet – Move an async function into its own thread in ...
by seangrogg on Monday January 29, 2018 @03:27PM
(#16260366)
Not the parent, but I find function vs fat arrow to be similar to:
* def vs lambda in Python
* fn vs closures in Rust
* def vs anonymous functions in Elixir
Honestly, given how often I find myself using small, immediately-consumed functions when performing common filter/map/reduce operations I find fat arrows to be an extremely welcome addition. I feel that it spares a lot of excessive "function" keywords everywhere and gives you just a little more room to have more verbose variable names when you have to deal with things like enforced maximum line lengths...
Re:Greenlet – Move an async function into its own thread in ...
by jaquers on Monday January 29, 2018 @09:48PM
(#16262525)
I write JavaScript/Node everyday. In my experience one does not write code like this when working with a team or a project that will be handed off; the author(s) are trying to minimize file size with expressions that are as small as possible. This seems okay to me for a library where your API is simply a function wrapper.
I haven't touched Javascript for a long time, especially using shiny features in ES5, ES6... those arrows always throws me off. Is this a typical JS & NodeJS style nowadays? Does anyone ever feel your code and your co-workers' code are barely readable?
Disclaimer: Python programmer.