ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1242176 - /ace/site/trunk/content/dev-doc/coding-standards.mdtext
Date Wed, 08 Feb 2012 23:35:39 GMT
Author: marrs
Date: Wed Feb  8 23:35:39 2012
New Revision: 1242176

URL: http://svn.apache.org/viewvc?rev=1242176&view=rev
Log:
More formatting fixes

Modified:
    ace/site/trunk/content/dev-doc/coding-standards.mdtext

Modified: ace/site/trunk/content/dev-doc/coding-standards.mdtext
URL: http://svn.apache.org/viewvc/ace/site/trunk/content/dev-doc/coding-standards.mdtext?rev=1242176&r1=1242175&r2=1242176&view=diff
==============================================================================
--- ace/site/trunk/content/dev-doc/coding-standards.mdtext (original)
+++ ace/site/trunk/content/dev-doc/coding-standards.mdtext Wed Feb  8 23:35:39 2012
@@ -377,12 +377,15 @@ Blank lines improve readability by setti
 Blank spaces should be used in the following circumstances:
 
 - A keyword followed by a parenthesis should be separated by a space.
-    `while (index > 5) {
+
+    while (index > 5) {
         // ...
-    }`
+    }
+    
     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.
+
     a += c + d;
     a = (a + b) / (c * d);
     a = (b > c) ? b : c;
@@ -400,18 +403,19 @@ Blank spaces should be used in the follo
 
 Naming conventions make programs more understandable by making them easier to read. They
can also give information about the function of the identifier.
 
-||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|
+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
 
 Downloads
 ---------



Mime
View raw message