Aesthetic aside, I am under the impression that people start programming, by and large, with imperative for/if style => so the imperative style is readable by more people. Even for more experienced programmers, reading imperative probably cost less energy, since it is more internalised?
Futhermore, in JS, the functionnal style is less performant (nearly twice on my machine, i assume because it do less useless memory allocations)
So, same functionnality, readable by more people, more performant? The imperative example seems like the better code.
From my anecdotical experience: more children from well off families are optimistic and have more tolerance to economic risks. It's not that they need the family's money to start a venture, but that they know they can fall back on it, if it doesn't go well
As a redis user for more than 8 years, i just want to say thank you. I had embedded redis 2.8 on small IoT system with 200mhz/64Mb of ram to huge cluster as a message bus (redis-as-kafka pattern).
Want a shared memory with a type system? Use redis. Want a queue? Use redis. Want something easy to mock, with an API in all major ecosystems? Use redis.
Futhermore, in JS, the functionnal style is less performant (nearly twice on my machine, i assume because it do less useless memory allocations)
So, same functionnality, readable by more people, more performant? The imperative example seems like the better code.