From 1430a454ed18ac3a815cc4d39c7dffd2e6ac9e90 Mon Sep 17 00:00:00 2001 From: jomo Date: Wed, 16 Jul 2014 00:33:43 +0200 Subject: removed camelcase, added more coding style to readme --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 64ea7d0..8f374a7 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,33 @@ Use 2 spaces to indent. Always use double-quotes! Only use single-quotes when the string contains double-quotes that would need to be escaped. +## Capitalization +Do not use camelCase for variable or function names! Use under_score naming. + +## Aligning variable assignments +In case you have multiple variable assignments, align the equals sign: + +```Python +# bad +foo = 1 +foobar = 2 +a = 3 + +# good +foo = 1 +foobar = 2 +a = 3 +``` + +## Vertical spacing +Use at least one space left and one space right to equals signs, and one space right to colons. + +## Horizontal spacing +Leave two empty lines before function definitions. In case you need to use `@hook.something`, add the two lines before that, directly followed by the definition. + +## Meaningful names +Give function and variable names meaningful names. If you want to shorten long names, that's fine, but leave a comment on assigment with the actual meaning. + ## Comments Comments are good! Please comment everything that's non-obious or makes it easier to understand -- cgit v1.2.3