It may be nice to also have a Quick Fix that introduce a method, i.e.,
def forceDoSomething() = doSomething(force = true)
Just saying
It may be nice to also have a Quick Fix that introduce a method, i.e.,
def forceDoSomething() = doSomething(force = true)
Just saying
Oh, three Ints are just as bad
in my experience, boolean parameters are typically introduced if a method can be used to do two different things, depending on that boolean flag. That
In Qt, they call this the Boolean Parameter Trap: http://doc.trolltech.com/qq/qq13-apis.html#thebooleanparametertrap
I fail to see why for example having a method taking three boolean parameters is necessarily more confusing to use than one taking three int parameters.
Do you mean why the quickfix is only available for booleans or why boolean arguments shouldn’t be used in APIs? First, I should really make that available for all parameters, that’s a good point
For why they’re bad in API, it just makes it really hard to use, it’s often better to use an enum or two separate methods.
What makes Boolean special compared to other types?