Scheme7
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Coding standards

Go down

Coding standards Empty Coding standards

Post  maximinus Fri Jun 04, 2010 11:29 pm

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.
maximinus
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China

Back to top Go down

Coding standards Empty Re: Coding standards

Post  maximinus Wed Jun 23, 2010 10:19 pm

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! cheers
maximinus
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum