Coding standards
Page 1 of 1
Coding standards
Based on Pep8:
4 spaces per indentation, use tabs not spaces.
Maximum line length 100 characters.
Variables - a noun, in lower_case_with_underscores
Functions - a verb, in mixedCase (first letter always lowercase)
Class - a noun, in StudlyCaps
Constants - CAPS_WITH_UNDERSCORES
Use docstrings, but keep them short!
Other guidlines:
Keep functions short, and make them do only one thing. More than 30 lines means we probably have a problem.
Make the names of functions and variables easy to understand.
Avoid using None if at all possible.
4 spaces per indentation, use tabs not spaces.
Maximum line length 100 characters.
Variables - a noun, in lower_case_with_underscores
Functions - a verb, in mixedCase (first letter always lowercase)
Class - a noun, in StudlyCaps
Constants - CAPS_WITH_UNDERSCORES
Use docstrings, but keep them short!
Other guidlines:
Keep functions short, and make them do only one thing. More than 30 lines means we probably have a problem.
Make the names of functions and variables easy to understand.
Avoid using None if at all possible.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Coding standards
For the main code, I will add unit tests starting this week.
I actually did a cyclomatic complexity check on the current code (SVN r71) and got a "This code looks all good!" result, that made my day!
I actually did a cyclomatic complexity check on the current code (SVN r71) and got a "This code looks all good!" result, that made my day!
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|