News for hackers. Stuff that matters.
Re:Get rid of boolean function parameters by rsp1984 on Monday June 15, 2015 @06:36AM (#9718525)
Even simpler: Just use a const variable instead of a constant literal in the caller code:

  const bool useWayA = true;
  int result = foo(a, b, useWayA);
instead of

  int result = foo(a, b, true);
Re:Get rid of boolean function parameters by mortoray on Monday June 15, 2015 @06:42AM (#9718542)
This would essentially be the enum option: giving names to constants. But this way wouldn't enforce the convention, you could still use `true` or `false`.