[Tutor] usage difference between tabs and spaces

Danny Yoo dyoo at hashcollision.org
Tue Sep 9 23:02:09 CEST 2014


> I am not an advanced programmer, but am very good with keyboard and find
> using tabs for syntax and formatting very helpful. But in this list and
> other python documentation i have repeatedly seen people recommending
> use of spaces.


Usually, you want to match the style used by the majority of the
community.  According to the community PEP-8:

    http://legacy.python.org/dev/peps/pep-0008/#tabs-or-spaces

it's spaces, and in particular, four spaces:

    http://legacy.python.org/dev/peps/pep-0008/#indentation

The overriding reason, as I understand it, is not technical, but
rather social: influential folks used that indentation level, the
style spread, and the community generally followed that style.  Now
it's the majority.


There is value in coming to terms with this: there are bigger, more
important issues out there.

Like big-endian vs little-endian.  :P


> I know that i can use any of them and use tabs as my preference.  But i
> would like to understand why hitting the poor keyboard 4/8/12 times is
> preferred than just hitting it 1/2/3 times.

You can use an editor that will do the right thing, but still let you
use your tab key the way you want.  What editor are you using now?


Best of wishes!


More information about the Tutor mailing list