Jump to: navigation, search

Difference between revisions of "Coding Conventions"

m (fixed Charter location)
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Sun has established coding standards that are generally considered reasonable, as evidenced by their widespread adoption by other Java-based development efforts (e.g., [http://jakarta.apache.org/ the Apache Jakarta project]). One of the goals is to make the Eclipse Platform blend in with the Java 2 platform. This goal is furthered by our following suit.
+
Oracle has established coding standards that are generally considered reasonable, as evidenced by their widespread adoption by other Java-based development efforts (e.g., [http://jakarta.apache.org/ the Apache Jakarta project]). One of the goals is to make the Eclipse Platform blend in with the Java platform. This goal is furthered by our following suit.
  
[http://java.sun.com/docs/codeconv/index.html Sun's Code Conventions for the Java Programming Language] covers filenames, file organization, indentation, comments, declarations, statements, white space, naming conventions, and programming practices. All code written for the Eclipse Platform should follow these conventions except as noted below. We deviate only in places where our needs differ from Sun's; when we do deviate, we explain why. (The section numbers shown below are Sun's.)
+
[http://web.archive.org/web/20090904195252/http://java.sun.com/docs/codeconv/index.html Oracle's Code Conventions for the Java Programming Language]
 +
<ref>Original URL (2014-05-05: broken): http://java.sun.com/docs/codeconv/index.html<br>
 +
A later version (2014-05-05: links from that page are broken): http://www.oracle.com/technetwork/java/index-135089.html<br>
 +
It's not just me, see e.g. [http://community.oracle.com/thread/3544233] or [http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8039151]</ref>
 +
covers filenames, file organization, indentation, comments, declarations, statements, white space, naming conventions, and programming practices. All code written for the Eclipse Platform should follow these conventions except as noted below. We deviate only in places where our needs differ from Oracle's; when we do deviate, we explain why. (The section numbers shown below are Oracle's.)
  
 +
*Section 3.1.1 Beginning Comments
 +
:The Eclipse project has specific guidelines for copyright notices to appear at the beginning of source files. See the [http://www.eclipse.org/eclipse/eclipse-charter.php Eclipse Project Charter] for details.
  
* Section 3.1.1 Beginning Comments
+
*Section 4 Indentation
The Eclipse project has specific guidelines for copyright notices to appear at the beginning of source files. See the [http://www.eclipse.org/eclipse/eclipse-charter.php Eclipse Project Charter] for details.
+
:We indent with tabs (4 spaces wide), since mixed indents are a mess.
  
* Section 9 Naming Conventions
+
*Section 9 Naming Conventions
The Eclipse project has more specific naming conventions. See Eclipse Project [[Naming Conventions]] for details.
+
:The Eclipse project has more specific naming conventions. See Eclipse Project [[Naming Conventions]] for details.
 +
 
 +
 
 +
For Javadoc conventions, see Oracle's [http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html How to Write Doc Comments for the Javadoc Tool] and [[Eclipse/API_Central]].
 +
 
 +
 
 +
References:
 +
<references/>

Latest revision as of 07:41, 26 May 2014

Oracle has established coding standards that are generally considered reasonable, as evidenced by their widespread adoption by other Java-based development efforts (e.g., the Apache Jakarta project). One of the goals is to make the Eclipse Platform blend in with the Java platform. This goal is furthered by our following suit.

Oracle's Code Conventions for the Java Programming Language [1] covers filenames, file organization, indentation, comments, declarations, statements, white space, naming conventions, and programming practices. All code written for the Eclipse Platform should follow these conventions except as noted below. We deviate only in places where our needs differ from Oracle's; when we do deviate, we explain why. (The section numbers shown below are Oracle's.)

  • Section 3.1.1 Beginning Comments
The Eclipse project has specific guidelines for copyright notices to appear at the beginning of source files. See the Eclipse Project Charter for details.
  • Section 4 Indentation
We indent with tabs (4 spaces wide), since mixed indents are a mess.
  • Section 9 Naming Conventions
The Eclipse project has more specific naming conventions. See Eclipse Project Naming Conventions for details.


For Javadoc conventions, see Oracle's How to Write Doc Comments for the Javadoc Tool and Eclipse/API_Central.


References:

  1. Original URL (2014-05-05: broken): http://java.sun.com/docs/codeconv/index.html
    A later version (2014-05-05: links from that page are broken): http://www.oracle.com/technetwork/java/index-135089.html
    It's not just me, see e.g. [1] or [2]