Skip to content
fraserharris edited this page Jan 6, 2012 · 29 revisions

I'd like to say we follow Google's code conventions / style guidelines, but we don't adhere to them 100%.

Python

In general, follow the Style Guide for Python Code - PEP 8: http://www.python.org/dev/peps/pep-0008/

Class Names

CamelCase

Property Names

prop_name

Variable Names

var_name

Not 1 letter unless it's a loop iterator

Javascript

Class Names

CamelCase

Property Names

propertyName

Variable Names

varName

Semicolons

Terminate all commands with semicolons. Never rely on semi-colon insertion, it has many ambiguous edge-cases.

HTML

Please try to indent things properly so we can line up closings!

General

Comments

You can never have too many.

Line Length

We aim for around 80 chars / line, but Barbara doesn't care AT ALL and will often go longer.

Braces

def fcn( param1, param2 )

ie. No space after fcn name, space between braces and params is optional

var foo = function( ) { // Curly brace goes on this line

}; // Curly brace gets it's own line - how lucky!

URIs & Folders

We try to mimic our directory structure in our URIs.

/s/shopify/beta is in /apps/sibt/shopify/templates/beta.html

/admin/* is in /apps/admin/__.py

/about is in /apps/homepage

Clone this wiki locally