<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jun 30, 2013 at 9:39 PM, Filip Pizlo <span dir="ltr"><<a href="mailto:fpizlo@apple.com" target="_blank">fpizlo@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Jun 19, 2013, at 9:41 AM, Dan Bernstein <<a href="mailto:mitz@apple.com">mitz@apple.com</a>> wrote:<br>
<br>
><br>
><br>
> On Jun 19, 2013, at 7:37 PM, Timothy Hatcher <<a href="mailto:timothy@apple.com">timothy@apple.com</a>> wrote:<br>
><br>
>> What about?<br>
>><br>
>> StyleResolver* existingStyleResolver()<br>
>> StyleResolver& styleResolver()<br>
><br>
> I like it.<br>
><br>
>><br>
>> — Timothy Hatcher<br>
>><br>
>><br>
>> On Jun 19, 2013, at 11:49 AM, Balazs Kelemen <<a href="mailto:kbalazs@webkit.org">kbalazs@webkit.org</a>> wrote:<br>
>><br>
>>> For me optional seems very misleading and generally different prefixes suggests that those objects are not the same.<br>
>>> Maybe IfExists does not sound nicely but at least it's clear. I would choose to have a pointer version with IfExists and a reference version which is a noun, like:<br>
>>><br>
>>> StyleResolver* styleResolverIfExists()<br>
<br>
</div>I like this more. I like that the use of 'if' in the name alerts me to the fact that the function will return something conditionally.<br>
<br>
By contrast, "existingFoo" only makes sense to me if I'm already aware of the idiom. And although I probably will *become* aware of the idiom it will still nonetheless be one of many idioms that I have to be aware of, so I fear that I'll forget why "Foo" is qualified with "existing". That's why I like "fooIfExists" - its super explicit about what is going on.<br>
</blockquote><div><br></div><div style>I concur. Maybe</div><div style><span style="font-family:'courier new',monospace">StyleResolver* styleResolverIfExists()</span><br></div><div style><div><font face="courier new, monospace">StyleResolver& styleResolver()</font></div>
<div>?<br></div></div><div style><br></div><div style>- R. Niwa</div><div style><br></div></div></div></div>