3 ms·
Moving away from the trivial example used for simple demonstration purposes... Have you ever written validator code for your inputs from a web form? It really
by sophacles 15y ago
Moving away from the trivial example used for simple demonstration purposes...
Have you ever written validator code for your inputs from a web form? It really is the same pattern, usually implemented via decorator rather than direct
result = validate(f, inputs)
calls, but decorators are just syntactic sugar for that.
Or are you really suggesting that every function which may take data from an input source copy and paste the same validation code to the top of that function?