Style Standards¶
Consistency is one of our goals for development and that is the reason why we need standards. Common standards must be applied to all other more specific standards if any rule is not overridden. Following these rules, there will be automatic checking tool to report any rule violations.
Common Standards¶
- Line length limit must be within 100 characters (80 characters limit is recommended)
- 4 spaces for indentation; no tab character is allowed
- No trailing whitespace
- An empty newline at the end of file
Document Standards¶
C/C++ Coding Standards¶
Python Coding Standards¶
- Unless specified, follow PEP 8
- Follow Google Python Style Guide
- Follow http://www.python.org/dev/peps/pep-0257/ for docs string
- Style checking tools:
- See more links:
- http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html
- http://deeplearning.net/software/pylearn/v2_planning/API_coding_style.html
- http://docs.python-guide.org/en/latest/writing/style/
- http://docs.ckan.org/en/latest/python-coding-standards.html
- http://courses.cms.caltech.edu/cs11/material/python/misc/python_style_guide.html
- https://sites.google.com/a/khanacademy.org/forge/for-developers/styleguide/python
- https://dev.launchpad.net/PythonStyleGuide
- http://www.pocoo.org/internal/styleguide/#styleguide
Java Coding Standards¶
- Follow Code Conventions for the Java TM Programming Language
- Follow Google Java Style but must use 4 spaces for indentation
- Interesting links:
JavaScript Coding Standards¶
- Follow Google JavaScript Style Guide but must use 4 spaces for indentation
- Style checking tools:
HTML, CSS Coding Standards¶
- Follow Google HTML/CSS Style Guide but must use 4 spaces for indentation
- This apply for CSS pre-processors like SASS, LESS, Stylus, etc.
- Style checking tools: