You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by ja...@apache.org on 2015/01/05 22:43:26 UTC

svn commit: r1649673 - /incubator/corinthia/www/policy_coding.html

Author: jani
Date: Mon Jan  5 21:43:26 2015
New Revision: 1649673

URL: http://svn.apache.org/r1649673
Log:
finalized first version of coding standards (waiting for holy water from dorte)

Modified:
    incubator/corinthia/www/policy_coding.html

Modified: incubator/corinthia/www/policy_coding.html
URL: http://svn.apache.org/viewvc/incubator/corinthia/www/policy_coding.html?rev=1649673&r1=1649672&r2=1649673&view=diff
==============================================================================
--- incubator/corinthia/www/policy_coding.html (original)
+++ incubator/corinthia/www/policy_coding.html Mon Jan  5 21:43:26 2015
@@ -53,18 +53,32 @@
 			<p>We aim not to make long and complicated rules for how to write code, because we believe rules makes programming be a lot more worklike than fun. BUT in order to have code that are maintainable, robust and easy readable we do need a minimum of rules.</p>
 			<p>The goal of this document is to describe what we have agreed to as the basis coding standard, for everything else we simply expect you follow what your experience tell you</p>
 			<p><b>Rules</b> are listed below. If you have suggestions please let us discuss it on our maling list dev@, no rule is set in stone !</p>
-			<h3>Use of indent</h3>
-			<p>In order to make the code aligment identical on all editors, we have 2 simple rules:</p>
-			<ul><li>* do NOT use TABulator in the source files (set the editor to convert it to spaces)</li>
-		            <li>* use 4 spaces for every indent level</li>
-			</ul>
+			<h4>Use of indent</h4>
+			<p>In order to make code aligment identical (aperance) on all editors, we have 2 simple rules:<br>
+			- do NOT use TABulator in the source files (set the editor to convert it to spaces)<br>
+			- use 4 spaces for every indent level<br>
+			Example:</p>
 			<code>
-				if (x == y) {
-				    z = 1;
-				}
-		        </code>
-			<h3>Placement of curly brackets '{'</h3>
-			<p>jan</p>
+			&nbsp;&nbsp;if (x == y)<br>
+			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z = 1;<br>
+			</code><br>
+			<h4>Placement of curly brackets '{'</h4>
+			<p>To make the code easier to read we use K&R style for groupings.<br>
+			Example:</p>
+			<code>
+			&nbsp;&nbsp;if (x == y) {<br>
+			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z = 1;<br>
+			&nbsp;&nbsp;}<br>
+			</code><br>
+			<h4>Use of platform dependent functions</h4>
+			<p><code>#ifdef WIN32</code> and similar platform specific defines outside "platform" is strictly forbidden. If you need a function not avialable on all supported platforms, it must be implemented in "platform" all other code must be written portable</p>
+			<h4>Include statements</h4>
+			<p>Only use <code>#include</code> in .c files, not in .h files</p>
+			<h4>Test functions</h4>
+			<p>Whenever you fix a bug or add new functionality, remember to add one or more test cases. Adding test cases ensures our code keeps being stable over time</p>
+			<h4>Recommandation</h4>
+			<p>We do not define naming conventions, or how to write the code as such. If you fix a bug, please try to make your code blend in with the existing code, so the code remains readable</p>
+			<p>And do not forget the most important thing: <b>have fun while you develop corinthia</p>
 	  	</div> 
       </div> 
 <!-- footer section -->