[webkit-dev] For your consideration: Naming scheme for fooIfExists/ensureFoo
esprehn at chromium.org
Wed Jun 19 16:22:29 PDT 2013
On Wed, Jun 19, 2013 at 9:46 AM, Andreas Kling <akling at apple.com> wrote:
> On Jun 19, 2013, at 6:37 PM, Timothy Hatcher <timothy at apple.com> wrote:
> What about?
> StyleResolver* existingStyleResolver()
> StyleResolver& styleResolver()
This doesn't make sense since calling styleResolver() again won't create a
new one so it's also "existing style resolver".
I rather like the foo() and ensureFoo() methods. foo() is just a plain
getter like any other method, the class may start with:
later we want to also allow optionally created when needed so we add:
The current naming and methodology makes a lot of sense. fooIfExists()
always bugs me because there's no reason to decorate a getter that is just
a plain getter. Adding an ensureFoo() method shouldn't make me rename the
existing foo() method to fooIfExists().
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev