4 ms·
I just find that minimizing parameters makes a mess with tons of side effects. When I see nothing but 0 and 1 parameter functions, the code is typically doing
by jcampbell1 13y ago
I just find that minimizing parameters makes a mess with tons of side effects. When I see nothing but 0 and 1 parameter functions, the code is typically doing the logical equivalent of refactoring `add(a,b);` into `push(a);push(b);add();` which makes a mess when there is more than the trivial case.
jQuery.ajax is a 33 parameter function. No one complains, and it is nice that it doesn't have side effects.
- jacques_chester 13y agoSure. Usually when you find a strict rule, it's a rule to be considered ceteris paribus -- when all other things are fixed in place. So while thinking about parameters, I think about minimising them and ignore other considerations. When thinking about side-effects, I think about minimising them and ignore other considerations. It's when the rules conflict that mere rule-following ends and professional judgement begins. Basically, as noted legal scholar Captain Barbossa observed, they're less like laws and more like guidelines.