Changes

Jump to: navigation, search

Programming guidelines

466 bytes added, 16:42, 9 March 2008
More explanation about spaces, TABs and indentation.
* Write [http://www.python.org/dev/peps/pep-0008/ PEP 8] compatible code! This is important to have a consistent, readable codebase.
** it is not explicit in PEP8, but we like a space after a comma
* Do not use tabsTABs. Use space characters. If In GRAMPS we use 4 spaces for indentation. This does not mean you use an editor with settable tab must set your TAB stops, go into to 4. TABs and indents are not the preferences same thing. Most editors have a configuration option to set indentation and change TAB stops. Be careful to just set the tab behavior '''indentation''' to use 4, which automatically means it has to be '''spaces'''. (TABs are still necessary, in Makefiles for example, and they '''have to''' be equivalent to 8 spaces only, '''always'''. In GRAMPS we use 4 ) To summarize:** uses spaces for , no TABs** indentationis 4** TAB stops (if any) are at position 9,17,25,...(first column is 1)
* Class headers. Each class should have a simple header to help mark it in the file. This is not used for documentation - it is used to help find the class when multiple classes exist in the same file.
3
edits

Navigation menu