Development Practices
1. Basics
- Common Principles
- First, learn Indico development style and workflow, then develop your module.
- Follow and keep Indico layers: Main core, rh, pages, wcomponents, services.
- As usual, no need to reinvent the wheel;
- There's a library that does it? Use it (unless the cost of using it is higher than that of doing it yourself);
- Use known design patterns as much as possible - patterns are a common language that allow us to better communicate ideas, and programming languages and libraries tend to follow them as well;
- If it's not obvious, add a comment;
- Use UTF-8 as encoding by default for every single file.
- Follow our naming conventions.
- Please, don't commit any trailing white spaces (see Dev/GitWorkflow)! If using Eclipse, AnyEditTools can help to remove trailing white spaces in all kind of test files.
- Python
- Use always 4 white spaces instead of TABs!
- Use consistent names for variables.
- Comment always your classes and methods, even if they look trivial for you.
- Use comments whenever you feel that people will not find out what a particular segment of code does just by reading it.
- Try to follow the PEP08 when formatting your Python code.
- Exception: historically variable names in Indico's Python are camelCase instead of using lower_case_with_underscores. The current development team still likes camelCase.
- Speak Python language
- Got new code? Pylint it before adding it to the repo.
- There are several tools for Eclipse than can help you to properly format your code and use Pylint, see PyDev formatter and Pylint with PyDev.
- JavaScript
- jslint your files as often as possible. It helps you prevent a lot of stupid mistakes. Emacs users have a nice jslint mode for that. Or see this guide to use jslint from Eclipse.
2. Version Control
Check the Git Workflow page.
3. Security
75551 contains a presentation on the topic. Most of it is described by the Security Guidelines
If you are working at CERN, we strongly recommend you to follow the course Developing secure software
4. HTML Specific Rules
Have Indico 100% HTML4.01 compliant (so far, this is an utopia for Indico...)
5. User Interface guidelines
See the User Interface Guidelines page.
Last modified 19 months ago
Last modified on 03/19/14 17:34:25