4 ms·
This is not obvious to me. The whole point was to separate the conditionals from the actions. In your example, it’s not clear if/how much “should we do this”
by efitz 1y ago
This is not obvious to me. The whole point was to separate the conditionals from the actions.
In your example, it’s not clear if/how much “should we do this” logic is in your function. If none, then great; you’ve implemented a find or lookup function and I agree those can be helpful.
If there’s some logic, eg you have to iterate through a set or query a database to find all the things that meet the criteria for “should do this”, then that’s different than what the original commenter was saying.
maybe:
doThis( findAllMatchingThings( determineCriteriaForThingsToDoThisTo()))
would be a good separation of concerns
- hinkley 1y agolet list = findHumansToKill(); //list = []; killHumans(list);
- deleted 1y ago[deleted]