[webkit-dev] …Inlines.h vs …InlineMethods.h
brendan at mozilla.org
Mon Nov 5 16:58:19 PST 2012
Filip Pizlo wrote:
> On Nov 5, 2012, at 4:15 PM, Brendan Eich<brendan at mozilla.org> wrote:
>> Implementation vs. interface distinctions can be fuzzy, but we've found it helpful to use this as a razor when shaving header files with inlines, before compile errors or compile time problems bite.
> I think that the total time spent fixing dependencies due to inline methods being in the main header is going to be less than the total time spent having to search through multiple headers when doing normal work.
Oh, for sure -- it doesn't make sense to expend effort changing existing
code just to match a vague rule about separating implementation from
interface. Sorry if I seemed to suggest that. I started from a general
"inline method implementations are not appropriate to put in interface
definitions" assertion but allowed for "even with a few short inline
methods defined within the class or right after it". I should have
allowed for other reasons not to split out FooInline.h.
> As I've pointed out in past messages in this thread, we have classes where the best documentation of a method is the method's body - hence having the body inline is a big win for productivity.
> This may have more to due with how JSC is laid out. I think the last time I encountered a need to put a method body outside of the main header was over a month ago, if not more.
That's cool. If you end up needing all the relevant headers and the
topological sort is straightforward, fewer files wins.
More information about the webkit-dev