However it's often not a good choice for function parameters.
For the basic case of a single argument function it's great:
nashlib_autofree_pointers(true);A reader knows exactly what is going on there.
However consider the case of a function which takes more than a single argument:
nashlib_autofree(NL_AUTORFREE_TYPE_POINTERS, true);
nashlib_config(NL_AUTOFREE, NL_POINTERS, true);And boom, suddenly maintainability is a problem.
Short version: Avoid bools for parameters. Use them for returns however.
No comments:
Post a Comment