ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r804291 - /websites/staging/ace/trunk/content/dev-doc/coding-standards.html
Date Wed, 08 Feb 2012 23:35:43 GMT
Author: buildbot
Date: Wed Feb  8 23:35:43 2012
New Revision: 804291

Log:
Staging update by buildbot for ace

Modified:
    websites/staging/ace/trunk/content/dev-doc/coding-standards.html

Modified: websites/staging/ace/trunk/content/dev-doc/coding-standards.html
==============================================================================
--- websites/staging/ace/trunk/content/dev-doc/coding-standards.html (original)
+++ websites/staging/ace/trunk/content/dev-doc/coding-standards.html Wed Feb  8 23:35:43 2012
@@ -498,18 +498,18 @@ public void printRange(List<span class="
 <h4 id="blank_spaces">Blank spaces</h4>
 <p>Blank spaces should be used in the following circumstances:</p>
 <ul>
-<li>A keyword followed by a parenthesis should be separated by a space.
-    <code>while (index &gt; 5) {
-        // ...
-    }</code>
-    Note that blanks should not be used between a method call and its opening parenthesis.
This helps to distinguish keywords from function calls.</li>
-<li>Blanks should appear after commas in argument lists.</li>
 <li>
-<p>All binary and ternary operators except "." should be separated from their operands
by spaces. Blanks should never separate unary operators such as unary minus, increment("++")
and decrement("--") from their operands.
-    a += c + d;
-    a = (a + b) / (c * d);
-    a = (b &gt; c) ? b : c;
-    xCoord--;</p>
+<p>A keyword followed by a parenthesis should be separated by a space.</p>
+<p>while (index &gt; 5) {
+    // ...
+}</p>
+<p>Note that blanks should not be used between a method call and its opening parenthesis.
This helps to distinguish keywords from function calls.
+- Blanks should appear after commas in argument lists.
+- All binary and ternary operators except "." should be separated from their operands by
spaces. Blanks should never separate unary operators such as unary minus, increment("++")
and decrement("--") from their operands.</p>
+<p>a += c + d;
+a = (a + b) / (c * d);
+a = (b &gt; c) ? b : c;
+xCoord--;</p>
 </li>
 <li>
 <p>The expressions in a for statement should be separated by blanks.</p>
@@ -522,18 +522,72 @@ public void printRange(List<span class="
 </ul>
 <h3 id="naming_conventionsanchornamingconventions">Naming conventions{anchor:namingconventions}</h3>
 <p>Naming conventions make programs more understandable by making them easier to read.
They can also give information about the function of the identifier.</p>
-<p>||Identifier Type||Rules for Naming||Examples||
-|(inner) classes, interfaces, enums and annotations|Names should be nouns, in mixed case
with the first letter of each word capitalised. Try to keep your names simple and descriptive.
Use whole words and avoid acronyms and abbreviations.|class Raster;\class TreeFrame;|
-|interfaces|Like class names, but if there is a name clash, the interface wins.|Repository|
-|services|Same as interfaces, so don't append "Service" as you usually do not know if an
interface is a service or not.|-|
-|implementation classes|If a class implements an interface, it should use the name of the
interface as part of its name, adding something specific for this implementation to it, or
Impl if that does not make sense.|class FileBasedRepository implements Repository; \class
VersionServlet implements HttpServlet; |
-|exceptions|Like class names; always ending in "Exception"|InputException|
-|methods|Methods should be verbs in mixed case with the first letter lowercase. Within each
method name capital letters separate words. Property methods or get-set methods are used as
follows:
-When a method is used to get a value start the method name with 'get'. When a method is used
to set a value start the method name with 'set'.|run(); \runFast(); \setBackground();|
-|variables (except for (constant) static final variables and member variables)|All variables
are in mixed case with a lowercase first letter. Words are separated by capital letters.|int
index;\float myWidth;|
-|member variables|The same capitalisation as for normal variables prefixed with 'm_'.|int
m_index;\float m_myWidth;|
-|constant (static final) variables, enum names|Names should be all uppercase with words separated
by underscores ("_").|public static final int BLACK = 99;|
-|packages|Lowercase only; avoid lengthy package names; always start with org.apache.ace.|org.apache.ace.demo.bundle|</p>
+<table>
+<thead>
+<tr>
+<th>Identifier Type</th>
+<th>Rules for Naming</th>
+<th>Examples</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>(inner) classes, interfaces, enums and annotations</td>
+<td>Names should be nouns, in mixed case with the first letter of each word capitalised.
Try to keep your names simple and descriptive. Use whole words and avoid acronyms and abbreviations.</td>
+<td>class Raster;\class TreeFrame;</td>
+</tr>
+<tr>
+<td>interfaces</td>
+<td>Like class names, but if there is a name clash, the interface wins.</td>
+<td>Repository</td>
+</tr>
+<tr>
+<td>services</td>
+<td>Same as interfaces, so don't append "Service" as you usually do not know if an
interface is a service or not.</td>
+<td>-</td>
+</tr>
+<tr>
+<td>implementation classes</td>
+<td>If a class implements an interface, it should use the name of the interface as
part of its name, adding something specific for this implementation to it, or Impl if that
does not make sense.</td>
+<td>class FileBasedRepository implements Repository; \class VersionServlet implements
HttpServlet;</td>
+</tr>
+<tr>
+<td>exceptions</td>
+<td>Like class names; always ending in "Exception"</td>
+<td>InputException</td>
+</tr>
+<tr>
+<td>methods</td>
+<td>Methods should be verbs in mixed case with the first letter lowercase. Within each
method name capital letters separate words. Property methods or get-set methods are used as
follows:</td>
+<td />
+</tr>
+<tr>
+<td>When a method is used to get a value start the method name with 'get'. When a method
is used to set a value start the method name with 'set'.</td>
+<td>run(); \runFast(); \setBackground();</td>
+<td />
+</tr>
+<tr>
+<td>variables (except for (constant) static final variables and member variables)</td>
+<td>All variables are in mixed case with a lowercase first letter. Words are separated
by capital letters.</td>
+<td>int index;\float myWidth;</td>
+</tr>
+<tr>
+<td>member variables</td>
+<td>The same capitalisation as for normal variables prefixed with 'm_'.</td>
+<td>int m_index;\float m_myWidth;</td>
+</tr>
+<tr>
+<td>constant (static final) variables, enum names</td>
+<td>Names should be all uppercase with words separated by underscores ("_").</td>
+<td>public static final int BLACK = 99;</td>
+</tr>
+<tr>
+<td>packages</td>
+<td>Lowercase only; avoid lengthy package names; always start with org.apache.ace.</td>
+<td>org.apache.ace.demo.bundle</td>
+</tr>
+</tbody>
+</table>
 <h2 id="downloads">Downloads</h2>
 <p>For various coding style checkers and IDE's we have configuration files that support
this style guide. You can download them from the list below:</p>
 <ul>



Mime
View raw message