+2011-10-10 Ryosuke Niwa <rniwa@webkit.org>
+
+ Style guide should mandate use of pass-by-reference for out arguments
+ https://bugs.webkit.org/show_bug.cgi?id=69766
+
+ Reviewed by Darin Adler.
+
+ This matches the convention used throughout WebCore.
+
+ * coding/coding-style.html:
+
2011-10-06 Amruth Raj <amruthraj@motorola.com>
Add Motorola Mobility to team.html
</pre>
</li>
+<li>Precede getters that return values through out arguments with the word "get".</li>
+<h4 class="right">Right:</h4>
+<pre class="code">
+void getInlineBoxAndOffset(InlineBox*&, int& caretOffset) const;
+</pre>
+
+<h4 class="wrong">Wrong:</h4>
+<pre class="code">
+void inlineBoxAndOffset(InlineBox*&, int& caretOffset) const;
+</pre>
+
<li>Use descriptive verbs in function names.
<h4 class="right">Right:</h4>
<pre class="code">
MyOtherClass::MyOtherClass() : MySuperClass() {}
</pre>
+</ol>
+
+<h3>Pointers and References</h3>
+
+<ol>
<li>Pointer types in non-C++ code — Pointer types should be written with a space between the
type and the * (so the * is adjacent to the following identifier if any).
const KCDashArray &dashes = dashArray();
</pre>
+<li>An out argument of a function should be passed by reference except rare cases where
+it is optional in which case it should be passed by pointer.
+
+<h4 class="right">Right:</h4>
+<pre class="code">
+void MyClass::getSomeValue(OutArgumentType& outArgument) const
+{
+ outArgument = m_value;
+}
+
+void MyClass::doSomething(OutArgumentType* outArgument) const
+{
+ doSomething();
+ if (outArgument)
+ outArgument = m_value;
+}
+</pre>
+
+<h4 class="wrong">Wrong:</h4>
+<pre class="code">
+void MyClass::getSomeValue(OutArgumentType* outArgument) const
+{
+ *outArgument = m_value;
+}
+</pre>
+
</ol>
<h3>#include Statements</h3>