[webkit-dev] For your consideration: Naming scheme for fooIfExists/ensureFoo

Darin Adler darin at apple.com
Tue Jun 18 19:09:37 PDT 2013

On Jun 18, 2013, at 7:05 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:

> requiredStyleResolver sounds as if it's a special (required) type of a style resolver as opposed to the caller requiring it.

That is true.

> Why don't we call it requireStyleResolver() instead?

Functions with return values don’t read well when they are verb phrases instead of noun phrases. It doesn’t make grammatical sense to perform an operation on a verb. Other ideas, maybe not so great:

    StyleResolver& mandatoryStyleResolver();
    StyleResolver& neededStyleResolver();

Not loving any of these yet, I guess. They seem to have the same problem as requiredStyleResolver.

-- Darin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130618/d9a982b9/attachment.html>

More information about the webkit-dev mailing list