I think /* explanation of what I'm doing */ is strictly worse than readableCode(UnderstandableParameter).<div><br></div><div>I'd rather have readable code than comments attempting to excuse unreadable code.</div><div>
<br></div><div>-eric</div><div><br><div class="gmail_quote">On Fri, Dec 3, 2010 at 1:57 PM, Antonio Gomes <span dir="ltr"><<a href="mailto:tonikitoo@gmail.com">tonikitoo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I do not think that XXX:repaint(true /* immediate */) is so bad<br>
either, if I understood Hyatt's comment correctly, and I agree with him on it.<br>
<br>
Having a enum is ideal, but no need for it to be mandatory, as other<br>
also pointed out.<br>
<div><div></div><div class="h5"><br>
On Fri, Dec 3, 2010 at 4:54 PM, Eric Seidel <<a href="mailto:eric@webkit.org">eric@webkit.org</a>> wrote:<br>
> I'm not sure we have any examples of bool passing like that in real code.<br>
> The case I'm concerned about is not one of single argument bools:<br>
> doSoemthing(bool)<br>
> but more of multi-argument functions:<br>
> doSomething(something, bool)<br>
> I'm trying to write a rule which can be easily automated by<br>
> check-webkit-style.<br>
> It's possible we could tighten the rule further to only allow<br>
> single-argument bools where "set" is in the function name.<br>
> It sounds like most folks are in agreement. We should add a rule like this<br>
> to check-webkit-style. Sounds like Dave Levin may already have something<br>
> partial in the works.<br>
> -eric<br>
> On Fri, Dec 3, 2010 at 1:45 PM, Ryosuke Niwa <<a href="mailto:rniwa@webkit.org">rniwa@webkit.org</a>> wrote:<br>
>><br>
>> On Fri, Dec 3, 2010 at 1:37 PM, David Hyatt <<a href="mailto:hyatt@apple.com">hyatt@apple.com</a>> wrote:<br>
>>><br>
>>> The only exception I would make to this rule is if all the call sites use<br>
>>> variables and never pass in raw true or false. In that case there's no loss<br>
>>> of readability, and whether you use an enum vs. a bool is irrelevant.<br>
>>> I think in general the rule should be "Keep your call sites readable, and<br>
>>> convert to enums if you find that the call sites are becoming inscrutable."<br>
>><br>
>> That rule makes sense to me.<br>
>> On Fri, Dec 3, 2010 at 1:40 PM, Eric Seidel <<a href="mailto:eric@webkit.org">eric@webkit.org</a>> wrote:<br>
>>><br>
>>> Dave, I'm not sure I understand your exception. Could you give an<br>
>>> example?<br>
>><br>
>> I think what he means is that<br>
>> bool doSomething();<br>
>> void doSomethingElse(bool);<br>
>> and the only case we always call doSomethingElse with a return value of<br>
>> some function or with a variable:<br>
>> doSomethingElse(doSomething());<br>
>> doSomethingElse(shouldNotDoSomethingElse);<br>
>> etc...<br>
>> and we never call it with raw true/false:<br>
>> doSomethingElse(true)<br>
>> doSomethingElse(false)<br>
>> - Ryosuke<br>
>><br>
>> _______________________________________________<br>
>> webkit-dev mailing list<br>
>> <a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
>> <a href="http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev" target="_blank">http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> webkit-dev mailing list<br>
> <a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
> <a href="http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev" target="_blank">http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev</a><br>
><br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<font color="#888888">--Antonio Gomes<br>
</font></blockquote></div><br></div>