Coding Conventions

Naming

Definitions

Camel case

Each word or abbreviation in the middle of the phrase begins with a capital letter, with no intervening spaces or punctuation.

Example: thisIsAnExample

Pascal case

The same as the camel case with the exception that the first letter is capitalized.

Example: ThisIsAnExample

Lowercase

All letters are lowercase, with no intervening spaces or punctuation.

Example: thisisanexample

Conventions

Language construction

Style

Language construction

Style

Variable name

Camel case

FETCH column aliases

Camel case

Type names

Lowercase

Type variables

Camel case

Method and Function names

Camel case

Method and Function parameter names

Camel case

Import aliases

Camel case

Workflow names

Pascal case

White-space

A single white-space should be put before and after punctuation or symbols.

Global rules

  1. No white-space before semicolon (;)

  2. No white-space before or after function call operator (→)

  3. No white-space before or after parenthesis

In assignments

White-space should be added before and after the equals (=) symbol.

Correct
var a = "test";
Incorrect
//No space before or after var a= "test"; var a="test"; var a ="test";

In expressions

White-space should be added before and after operators.

Correct
var a = (1 + 1) * 2; if (a > 10 or a < 10) return 0;
Incorrect

New lines

  1. No new lines should be added before open curly braces.

  2. Close curly brace should always be on new lines and should be followed by new line.

  3. Two consecutive new lines are forbidden.

If-else statement

Correct
Incorrect

FETCH expression

Depending on the size of your FETCH expression you have more choices.

Short single entity FETCH expressions should be written on the same line as the variable declaration. If the length of the variable declaration, assignment and FETCH expression exceeds 80 characters the variable declaration and assignment should be on one line and the FETCH expression on a new line with a single indentation.

Multiple entity FETCH expression should always be broken in multiple lines.

Methods or Functions

  1. Methods and Functions should have new lines before and after

Correct
Incorrect