Coding Guidelines - famish99/MuchoCorazon GitHub Wiki

PEP 8

We will abide by PEP 8 for this project.

The tl;dr version of it

Spaces not tabs!

Yeah I hate editing files using soft tabs too, but it's the only way it'll look consistent across editors and easier to find out where there may be indentation errors. Indentation should be equivalent to 4 spaces.

In vim:

set softtabstop=4
set shiftwidth=4
set expandtab

Also a quick tip for vim users: if you're in insert mode you can quickly tab using ^t (ctrl+t) and unindent with ^d (ctrl+d).

Variable Names

The table below will describe this.

  • lower_case_with_underscores: for local variables and method definitions
  • UPPER_CASE_WITH_UNDERSCORES: for global variables
  • CamelCase: for class names