2 ms·
I use the toolz package for currying and a few other conveniences. That plus named tuples and a little discipline gets me 80+% of the benefits of pure function
by bloaf 3y ago
I use the toolz package for currying and a few other conveniences.
That plus named tuples and a little discipline gets me 80+% of the benefits of pure functional.
The biggest thing to me wasn't in your list: lack of tail call optimization means you have to be a bit careful about where you use recursion.
I personally think long anonymous functions are an anti-pattern, naming your functionality is great for readability. I learned this from Wolfram language which makes heavy use of anonymous functions, I would often find myself returning from lunch to find my code which was perfectly clear that morning had become unintelligible. Today I try to limit anonymous functions to re-ordering arguments or "picking" functions that pull simple values out of more complicated data structures.