3 ms·
Boolean parameter can be useful (for DRY-ness, etc.), but to prevent any misunderstandings, I almost always introduce descriptive constants in such cases: co
by przemoc 13y ago
Boolean parameter can be useful (for DRY-ness, etc.), but to prevent any misunderstandings, I almost always introduce descriptive constants in such cases:
const bool SOMETHING = false;
const bool OTHERTHING = true;
and use them strictly for such parameter.
When there is a default parameter value, sometimes even only one constant can be enough (for non-default variant description).