8 ms·
What if car_is_empty() function is actually a heavy call to a service that needs error handling, monitoring, logging etc. E.g. log needs to contain what car was
by deepsun 7y ago
What if car_is_empty() function is actually a heavy call to a service that needs error handling, monitoring, logging etc. E.g. log needs to contain what car was that that we omitted.
It's not that easy anymore with functional programming.
- dgb23 7y agoYou would avoid doing this in either style but instead build a query or batch. A good argument for the second example is readability. The first one re-invents map & filter which are well known and quickly understood.