Skip to content
1337 edited this page May 18, 2012 · 29 revisions

Languages

Python

Always follow both PEP 20 - The Zen of Python and PEP 8 - Style Guide for Python Code. In the case that PEP 8 and PEP 20 tells you to do different things, follow PEP 20.

Great examples of that Zen here

Line Length

Strictly less than or equal to 79 characters.

Class Names

CamelCase

Property Names

prop_name

Variable Names

var_name

  • Not 1 letter unless it's a loop iterator
  • For a unused variable (loop iterator, unpacking), use _

Javascript

Tag style

This one is absolutely bullet-proof, and is recommended on all client-sided pages.

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

Git

Commit message

Keep in format of:

{Present tense verb} one-liner about the commit

- change #1
- change #2
- change #3

Example:

Add SIBT mass emailer

- can only select one version
- HTML tags allowed

Review

Avoid useless comments!

Clone this wiki locally