All JavaScript code associated with the Echo framework / hosted on this site uses a specific code convention for JavaScript. This coding convention is based on our Java Code Conventions and thus transitively on Sun's Code Conventions for the Java Programming Language when they can be applied to JavaScript.
- All global objects should exist in namespaces
- Object and array literals should be used over
new Object()
or new Array()
declarations whenever possible.
- Double quotes (") are used rather than single quotes (').
- Semicolons are always required.
- Indentation is done exclusively with spaces. Tabs are not allowed. Indentation unit is four (4) spaces.
- Lines should be wrapped at a 132 column margin.
- Braces are always used to enclose the bodies of if/for/while/try statements.
- JSDoc comments are used for API specifications.