4 ms·
The example with the number is poorly chosen. It is overly simplistic and can easily be implemented as as something like (pseudocode) bool satisfies_all(value,
by DarkWiiPlayer 7y ago
The example with the number is poorly chosen. It is overly simplistic and can easily be implemented as as something like
(pseudocode) bool satisfies_all(value, functions) { for each funcction in functions { return false if not function(value) }; return true }
I get that the author wanted to go with a very basic example to keep it easy to understand, but it seems like that's the main problem with the proposed mechanism: It gets very hard to understand very quickly, leading to spaghetti code.