[webkit-dev] Fwd: Bools are strictly worse than enums
rniwa at webkit.org
Fri Dec 3 14:45:41 PST 2010
On Fri, Dec 3, 2010 at 2:30 PM, Darin Adler <darin at apple.com> wrote:
> > I think in general the rule should be "Keep your call sites readable,
> and convert to enums if you find that the call sites are becoming
> Beyond the enum guidelines, it’s also true that functions with these
> boolean/enum arguments often indicate minor design mistakes. Many times we
> would be better off with multiple functions rather than a single function
> with an enum argument.
I agree. I prefer to have multiple public functions that are named
accordingly than having a single public function with enums. However, we
could have a private function with enum that implements these public
functions to share code.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev