[webkit-dev] Naming scheme for fooIfExists/ensureFoo - Round 2
Ryosuke Niwa
rniwa at apple.com
Thu Oct 3 13:47:21 PDT 2024
Hi all,
We discussed this topic 11 years ago in https://lists.webkit.org/pipermail/webkit-dev/2013-June/025056.html but we seem to have never codified it in our coding style guideline. It really bothers me that we have a mixture of two styles so I’d like to propose that we pick one style and put that into style guideline & style checker.
The question is as follows. A pair of functions which lazily construct an object and one which returns nullptr if the object had not already been constructed can be named:
StyleResolver* styleResolver();
StyleResolver& ensureStyleResolver();
or:
StyleResolver* styleResolverIfExists();
StyleResolver& styleResolver();
Which one should we use?
- R. Niwa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20241003/27aad1aa/attachment.htm>
More information about the webkit-dev
mailing list