Forum Archive

Code styling

scj643

I've been coding with pycharm and was thinking we should follow standards. One thing I've noticed is by default Pythonista uses tabbed indenting where in https://www.python.org/dev/peps/pep-0008/ its a 4 space indent that is recommended.

omz

You can use 4 spaces in Pythonista if you like, there's a setting for that (under "Indentation"). The reason Pythonista uses tabs by default (and a tab width of 2 spaces) is mostly that it tends to be used on very small screens...

ccc

The soft tabs and show mixed indentation options in Pythonista give you the best of both worlds. I always keep them both turned on. It is kind of anachronistic that all the example scripts use tabs.