

Rather than use a flag argument, define separate methods - invisiblefunnel
http://martinfowler.com/bliki/FlagArgument.html

======
bartonfink
I'm not sure this sort of logic scales. The examples he uses with a single
boolean are simple enough because you're just writing two methods instead of
one. What if, however, you have a signature that takes multiple booleans,
either as formal parameters or as part of a struct? Do you write exponentially
more methods, requiring the caller to be familiar with your naming
conventions, just to free the caller from having to remember what the
parameters represent? For that matter, what if you're passing in an
enumeration? That's also a "flag" that is frequently used to switch behavior,
and again, would require expanding one method into n, each with human-readable
names.

If there's some a way to win big by doing this, I just don't see it.

