Skip to content

Coding Style

Man-Long Wong edited this page Jun 27, 2017 · 20 revisions

Programming language

We use Python 2 as the core programming language for the core modules.

Naming convection

It is recommended to use:

  1. UpperCamelCase for class names
  2. lowerCamelCase for methods and functions
  3. CAPITALIZED_WITH_UNDERSCORES for constants
  4. lowercase_separated_by_underscores for variable names
  5. lowercase_separated_by_underscores for python file names
  6. UpperCamelCase for names of Jupyter Notebook test scripts

Indentation

4 spaces of indentation, and no tab characters should be used.

Comments

Triple quote format is preferred for docstring that appears as first statement in classes, methods or functions.

A single line above the code is recommended.

Others

Use two empty lines between def's.

Clone this wiki locally