[webkit-dev] Growing tired of long build times? Check out this awesome new way to speed up your build... soon (HINT: It's not buying a new computer)

Darin Adler darin at apple.com
Tue Aug 29 09:05:10 PDT 2017


> On Aug 28, 2017, at 8:34 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> 
>> Wherever possible, we are going to want to convert file-static functions
>> into private C++ class member functions.
> 
> I don't think we should make this change. It would mean that whenever
> the function signature changes, we'd have to modify the header file,
> which in turn triggers rebuild of every cpp file which includes that
> header file.


That was my first thought as well. In fact, I typically ask people to do the opposite: Whenever a function does not require access to private members, convert from a member function that has to be in the header file to a function that is private to the source file.

More recently I have started doing something different for the many functions that only have to be used on one place; I use lambdas to create nested functions. This has a couple nice properties: The lambda shares access to private members and anything else that the surrounding function has access to. We have the option of capturing rather than passing arguments, which can be clearer in some cases. It’s not quite as good as a separate function for visual separation; the lambda is often mashed together with the rest of the surrounding function.

— Darin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20170829/0917385d/attachment-0001.html>


More information about the webkit-dev mailing list