You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jj...@apache.org on 2012/09/29 03:37:05 UTC

svn commit: r1391724 - /incubator/kafka/site/coding-guide.html

Author: jjkoshy
Date: Sat Sep 29 01:37:05 2012
New Revision: 1391724

URL: http://svn.apache.org/viewvc?rev=1391724&view=rev
Log:
Update coding convention with note on case classes vs tuples.

Modified:
    incubator/kafka/site/coding-guide.html

Modified: incubator/kafka/site/coding-guide.html
URL: http://svn.apache.org/viewvc/incubator/kafka/site/coding-guide.html?rev=1391724&r1=1391723&r2=1391724&view=diff
==============================================================================
--- incubator/kafka/site/coding-guide.html (original)
+++ incubator/kafka/site/coding-guide.html Sat Sep 29 01:37:05 2012
@@ -33,6 +33,7 @@ We are following the style guide given <
 <li>Use named arguments when passing in literal values if the meaning is at all unclear, for example instead of <code>Utils.delete(true)</code> prefer <code>Utils.delete(recursive=true)</code>.
 <li>Indentation is 2 spaces and never tabs. One could argue the right amount of indentation, but 2 seems to be standard for scala and consistency is best here since there is clearly no "right" way.</li>
 <li>Include the optional paranthesis on a no-arg method only if the method has a side-effect, otherwise omit them. For example <code>fileChannel.force()</code> and <code>fileChannel.size</code>. This helps emphasize that you are calling the method for the side effect, which is changing some state, not just getting the return value.</li>
+<li>Prefer case classes to tuples. Although tuples are easy to use, tuples are suitable only in a purely local context and only when you combine data that has no meaning beyond an A and a B.</li>
 </ul>
 
 <h2>Logging</h2>