[webkit-dev] …Inlines.h vs …InlineMethods.h

Gavin Barraclough barraclough at apple.com
Mon Nov 5 17:39:52 PST 2012


These rules generally look great.  One suggestion:

On Nov 5, 2012, at 8:47 AM, Geoffrey Garen wrote:
> (5) Adopt the convention that any function that is not as trivial as "int x() { return m_x; }" moves out of the class declaration.

How about we simplify this slightly to:

(5) Adopt the convention that any function that is nontrivial should be moved out of the class declaration.

We can give an example as to what might constitute trivial if we wish (e.g. is a one liner), but I think leaving a little wiggle room to allow developers to apply common sense would be a good thing.  While moving all complex functions out of class definitions sounds good, for some small classes being able to leave some very simple functions in the class declaration might not hurt, and might make the code easier to work with.  E.g.:

int y()
{
	ASSERT(m_y != BAD_VALUE);
	return m_y;
}

cheers,
G.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121105/dad209a5/attachment.html>


More information about the webkit-dev mailing list