FlexSEA Wiki

A WEARABLE ROBOTICS TOOLKIT

User Tools

Site Tools


styleguidepython

Dephy Python Programming Style Guide

Programming in C/C++? Dephy C/C++ Programming Style Guide

General

  • Use tabulations, not spaces. If you have to specify the tab size, use 4.
  • All files need to end with an empty line.
  • As a general rule, make sure that your code looks clean and similar to the existing code (when existing code is provided). More examples below.
  • Comments should always start with a capital letter
  • Do not commit random empty lines. There should never be more than one (1) empty line.
  • Do not use “”“ ”“” for comments that are on a single line, use '#'
  • Use parentheses with conditional statements

Operators and spaces

Good:

myVar = (i * 20) / (a + 1)

Bad:

myVar = (i*20)/(a+1)

Good:

myVar = 123

Bad:

myVar=123
styleguidepython.txt · Last modified: 2020/04/08 14:25 by jfduval