40 ms·
In the explicit version you need to make sure you push car_id instead of i. There are more opportunities for decisions like that the longer the logic chain. Th
by swsieber 6y ago
In the explicit version you need to make sure you push car_id instead of i. There are more opportunities for decisions like that the longer the logic chain.
The big impact as I see it is that it removes non-important bits and keeps you from messing those up, namely picking the right variable and indexing. Each new lambda in the chain is scoped to it's inputs, not all previous inputs in the iteration.
- meheleventyone 6y agoI think this falls under getting the lambda and choice of function right. Likewise more complex expressions are easy to get wrong. There are implementation details to both you need to nail. Is it better to fail in referencing the wrong variable or calling the wrong function with the wrong (but valid) input? Which is to say if you get the implementation details wrong you’ve got the implementation wrong and notice very quickly with any halfway reasonable test.