I like to build cool things, work with nice people and help others where I can. Currently I'm an engineering manager for a fintech startup and historically a serial founder & freelancer software dev.
Location
Mรผnchen, Deutschland ๐ฉ๐ช
Education
The Open University
Work
Engineering Manager @ Deutsche Fintech Solutions GmbH
Yeah, I had considered that when writing the article but I was wondering if beginner devs might get confused somewhat with executing a function in the queue before the queue is run.
Seeing your example though, I may have to reconsider that since it isnโt as it was in my head at first glance and you have a point that it feeds into the next article on currying anyway.
By the way, I noticed you work at Columbia road, Iโm at Futurice so we are basically working at sister companies ๐ ... small world!
Yeah, I see that higher-order functions like that could be confusing if used without much explanation.
But your currying examples make these higher-order functions even nicer to create (eg. curriedAdd). It could be cool to refer back to this example at the end of the currying article, as a kind of "application of what we have learned: now we can make the composition look cleaner!)
By the way, I noticed you work at Columbia road, Iโm at Futurice so we are basically working at sister companies ๐ ... small world!
I like to build cool things, work with nice people and help others where I can. Currently I'm an engineering manager for a fintech startup and historically a serial founder & freelancer software dev.
Location
Mรผnchen, Deutschland ๐ฉ๐ช
Education
The Open University
Work
Engineering Manager @ Deutsche Fintech Solutions GmbH
Nice article series!
Just pointing out: an alternative that could give even cleaner code for this specific calculation example is to use higher-order functions.
So instead of:
You could have this:
This way you're creating the functions on the fly in
composeWith
. I'd argue that comes closer to natural language ("first multiply by 2, then add 1").This is basically a teaser for your next article about currying :)
Yeah, I had considered that when writing the article but I was wondering if beginner devs might get confused somewhat with executing a function in the queue before the queue is run.
Seeing your example though, I may have to reconsider that since it isnโt as it was in my head at first glance and you have a point that it feeds into the next article on currying anyway.
By the way, I noticed you work at Columbia road, Iโm at Futurice so we are basically working at sister companies ๐ ... small world!
Yeah, I see that higher-order functions like that could be confusing if used without much explanation.
But your currying examples make these higher-order functions even nicer to create (eg.
curriedAdd
). It could be cool to refer back to this example at the end of the currying article, as a kind of "application of what we have learned: now we can make the composition look cleaner!)This is no coincidence ;) I came here through the last Futu Dev Breakfast newsletter that linked to your article about piping!
I didn't even know Lucia added my article there... Fair enough though, good to know!