3 ms·
A wonky parametrization is probably sign that you are refactoring at the wrong level. If you have something like function doStuff(flag: boolean) { // do some
by mrighele 2y ago
A wonky parametrization is probably sign that you are refactoring at the wrong level. If you have something like
function doStuff(flag: boolean) {
// do some stuff
if (flag) {
// do stuff a
} else {
// do stuff b
}
// more stuff
}
you may want to do two implementations that are something like
function doStuffA() {
doSomething();
doStuffSpecificForA();
doSomethingElse();
}
and
function doStuffB() {
doSomething();
doStuffSpecificForB();
doSomethingElse();
}